Remove extra promise nonsense
parent
6d16778d3d
commit
2f601ad509
|
@ -2,8 +2,7 @@ import {proxy} from 'utils/queryUrlGenerator';
|
|||
import _ from 'lodash';
|
||||
|
||||
export function getCpuAndLoadForHosts(proxyLink) {
|
||||
return new Promise((resolve, reject) => {
|
||||
proxy({
|
||||
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 "telegraf"."default"."system" where time > now() - 10m group by host`,
|
||||
db: 'telegraf',
|
||||
|
@ -23,7 +22,6 @@ export function getCpuAndLoadForHosts(proxyLink) {
|
|||
hosts[s.tags.host].load = (Math.round(s.values[0][meanIndex] * precision) / precision).toFixed(2);
|
||||
});
|
||||
|
||||
resolve(_.values(hosts));
|
||||
}).catch(reject);
|
||||
return _.values(hosts);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue