From 693eabea65fde38810d3aca03cc8fc1797ad3b01 Mon Sep 17 00:00:00 2001 From: Brian Baker Date: Thu, 18 May 2017 23:03:22 -0600 Subject: [PATCH] change array-join to multi-line template --- ui/src/hosts/apis/index.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ui/src/hosts/apis/index.js b/ui/src/hosts/apis/index.js index 6548700727..7a8bd4474d 100644 --- a/ui/src/hosts/apis/index.js +++ b/ui/src/hosts/apis/index.js @@ -5,14 +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"'].join('; '), + 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 = {}