adejoux / nmon2influxdb

Make NMON data dynamic with InfluxDB
GNU Affero General Public License v3.0
80 stars 29 forks source link

Dashboard: CPU total usage graph #49

Closed adilnaimi closed 7 years ago

adilnaimi commented 7 years ago

This is not really an issue, I wanted to graph the total CPU usage (between 0-100%)

The CPU_ALL table doesn't have the a value for cpu usage:

> SELECT * FROM CPU_ALL LIMIT 5
name: CPU_ALL
time                host            name          value
----                ----            ----          -----
1450783583000000000 AIX_71_TEST     Idle%         99.1
1450783583000000000 AIX_71_TEST     Sys%          0.3
1450783583000000000 AIX_71_TEST     PhysicalCPUs  128
1450783583000000000 AIX_71_TEST     Wait%         0
1450783583000000000 AIX_71_TEST     User%         0.6

My guess is the total CPU usage= SUM (User+Sys+Wait)

I've tried this but couldn't generate a graph:

SELECT sum("value") FROM "CPU_ALL" WHERE "host" =~ /^$host$/ AND "name" = 'Sys%' AND "name" = 'User%' AND "name" = 'Wait%' AND $timeFilter GROUP BY time($interval) fill(null)

is there a way to generate a graph based on the above formula?

adejoux commented 7 years ago

Hello,

You can do it like that: image

It's important to sum the values instead of averaging them.

But I think it's better to use EC stats from LPAR. Percents in cpu_all doesn't mean the same thing when you are under or above entitlement for uncapped partitions. Something like that: image

Regards,

Alain

adilnaimi commented 7 years ago

thanks for the awesome help