Fix broken cpu reporting on hosts page and normalize InfluxQL

pull/10616/head
Nathan Haugo 2017-06-21 16:56:52 -07:00
parent 34808ddb9d
commit 3526272f49
1 changed files with 7 additions and 7 deletions

View File

@ -5,13 +5,13 @@ import _ from 'lodash'
export function getCpuAndLoadForHosts(proxyLink, telegrafDB) {
return proxy({
source: proxyLink,
query: `select mean(usage_user) from cpu where cpu = "cpu-total" and time > now() - 10m group by host;
select mean("load1") from "system" where time > now() - 10m group by host;
select non_negative_derivative(mean(uptime)) as deltaUptime from "system" where time > now() - 10m group by host, time(1m) fill(0);
select mean("Percent_Processor_Time") from win_cpu where time > now() - 10m group by host;
select mean("Processor_Queue_Length") from win_system where time > now() - 10s group by host;
select non_negative_derivative(mean("System_Up_Time")) as deltaUptime from "telegraf"."autogen"."win_uptime" where time > now() - 10m group by host, time(1m) fill(0);
show tag values from /win_system|system/ with key = "host"`,
query: `SELECT mean("usage_user") FROM cpu WHERE "cpu" = 'cpu-total' AND time > now() - 10m GROUP BY host;
SELECT mean("load1") FROM "system" WHERE time > now() - 10m GROUP BY host;
SELECT non_negative_derivative(mean(uptime)) AS deltaUptime FROM "system" WHERE time > now() - 10m GROUP BY host, time(1m) fill(0);
SELECT mean("Percent_Processor_Time") FROM win_cpu WHERE time > now() - 10m GROUP BY host;
SELECT mean("Processor_Queue_Length") FROM win_system WHERE time > now() - 10s GROUP BY host;
SELECT non_negative_derivative(mean("System_Up_Time")) AS deltaUptime FROM "telegraf"."autogen"."win_uptime" WHERE time > now() - 10m GROUP BY host, time(1m) fill(0);
SHOW TAG VALUES FROM /win_system|system/ WITH KEY = "host"`,
db: telegrafDB,
}).then(resp => {
const hosts = {}