I would like to know whether its possible to do the above mentioned calculation. Kindly help on this. Since I got stuck at this point in production environment.
On Friday, 2 December 2016 17:11:20 UTC+5:30, kmg wrote: > > > I checked the docs and tried multiple queries. Final I stopped at this > stage. > > select sum(value) from ucd_cpu where hostname='localhost' and oid=~ > /^ssCpuRaw*/ and time > '2016-09-18T22:47:53.408149394Z' and time < > '2016-09-18T22:52:53.531283581Z' group by time(5m) > this query just sum all the 5mins value. shows correct output. > > Then I moved to next stage by dividing ssCpuRawUser value by above sum > output, the below query I tried, but return empty output > select mean(ssCpuRawUser.value) / sum(value) from ucd_cpu where > hostname='localhost' and oid=~ /^ssCpuRaw*/ and time > > '2016-09-18T22:47:53.408149394Z' and time < > '2016-09-18T22:52:53.531283581Z' group by time(5m) > > Kindly someone help me on this > > On Thursday, 1 December 2016 18:55:03 UTC+5:30, kmg wrote: >> >> I'm new to influxdb. I tried to calculate the CPU usage. >> >> Data inserted into influxdb with 5mins interval. >> >> my Calculation for Every 5mins: >> >> CPU_usage = [ ssCpuRawUser / >> (ssCpuRawUser+ssCpuRawNice+ssCpuRawSystem+ssCpuRawIdle+ssCpuRawSoftIRQ) ] * >> 100 >> >> Please share me the query for the above calculation >> >> Here is the value inserted into influxdb: >> time hostname idle nice oid system user value >> 2016-11-29T12:02:25.278201112Z "dev.app1.local" 109864350 108493 1689895 >> 3204339 >> 2016-11-29T12:02:25.282359773Z "dev.app1.local" "ssCpuRawUser" 3204339 >> 2016-11-29T12:02:25.286145038Z "dev.app1.local" "ssCpuRawNice" 108493 >> 2016-11-29T12:02:25.290602074Z "dev.app1.local" "ssCpuRawSystem" >> 1689895 >> 2016-11-29T12:02:25.294064947Z "dev.app1.local" "ssCpuRawIdle" 109864350 >> 2016-11-29T12:02:25.297439427Z "dev.app1.local" "ssCpuRawInterrupt" 22029 >> 2016-11-29T12:02:25.300748476Z "dev.app1.local" "ssCpuRawSoftIRQ" 71358 >> 2016-11-29T12:02:25.303927833Z "dev.app1.local" "ssCpuRawKernel" 0 >> 2016-11-29T12:02:25.307150225Z "dev.app1.local" "ssCpuRawWait" 59377 >> 2016-11-29T12:07:20.890506803Z "dev.app1.local" 109892078 108526 1690392 >> 3205285 >> 2016-11-29T12:07:20.895151041Z "dev.app1.local" "ssCpuRawUser" 3205285 >> 2016-11-29T12:07:20.898875923Z "dev.app1.local" "ssCpuRawNice" 108526 >> 2016-11-29T12:07:20.902326522Z "dev.app1.local" "ssCpuRawSystem" >> 1690392 >> 2016-11-29T12:07:20.905513396Z "dev.app1.local" "ssCpuRawIdle" 109892078 >> 2016-11-29T12:07:20.90856002Z "dev.app1.local" "ssCpuRawInterrupt" 22042 >> 2016-11-29T12:07:20.911568897Z "dev.app1.local" "ssCpuRawSoftIRQ" 71392 >> 2016-11-29T12:07:20.914664004Z "dev.app1.local" "ssCpuRawKernel" 0 >> 2016-11-29T12:07:20.917818936Z "dev.app1.local" "ssCpuRawWait" 59390 >> >> >> -- Remember to include the version number! --- You received this message because you are subscribed to the Google Groups "InfluxData" group. To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+unsubscr...@googlegroups.com. To post to this group, send email to influxdb@googlegroups.com. Visit this group at https://groups.google.com/group/influxdb. To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/91f7e614-9a05-449a-9e0c-a4def2e0caf9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.