diff --git a/client/src/components/nodeCpuChart.tsx b/client/src/components/nodeCpuChart.tsx index f103961..78d7adc 100644 --- a/client/src/components/nodeCpuChart.tsx +++ b/client/src/components/nodeCpuChart.tsx @@ -4,14 +4,23 @@ import Chart from './chart'; import LoadingChart from './loadingChart'; import {parseCpu, TO_ONE_CPU} from '../utils/unitHelpers'; import {Node, Metrics} from '../utils/types'; +import PrometheusGraph from '../views/prometheusgraph'; export default function NodeCpuChart({items, metrics}: {items?: Node[], metrics?: _.Dictionary}) { const totals = getNodeCpuTotals(items, metrics); + const query = { + queryString: 'instance:node_cpu:ratio', + title: 'Node CPU Usage', + }; return (
{totals ? ( - + // + ) : ( )} diff --git a/client/src/components/nodeRamChart.tsx b/client/src/components/nodeRamChart.tsx index 4896da3..6722762 100644 --- a/client/src/components/nodeRamChart.tsx +++ b/client/src/components/nodeRamChart.tsx @@ -4,6 +4,7 @@ import Chart from './chart'; import LoadingChart from './loadingChart'; import {parseRam, parseUnitsOfRam} from '../utils/unitHelpers'; import {Node, Metrics} from '../utils/types'; +import PrometheusGraph from '../views/prometheusgraph'; export default function NodeRamChart({items, metrics}: {items?: Node[], metrics?: _.Dictionary}) { const totals = getNodeRamTotals(items, metrics); @@ -11,16 +12,25 @@ export default function NodeRamChart({items, metrics}: {items?: Node[], metrics? const used = parseUnitsOfRam(totals && totals.used, available && available.unit); const decimals = used && used.value > 10 ? 1 : 2; + const query = { + queryString: 'instance:node_memory_utilisation:ratio', + title: 'Node Memory Usage', + }; + return (
{totals ? ( - + // ) : ( )} diff --git a/client/src/views/prometheusgraph.tsx b/client/src/views/prometheusgraph.tsx index f3df401..483f993 100644 --- a/client/src/views/prometheusgraph.tsx +++ b/client/src/views/prometheusgraph.tsx @@ -67,17 +67,17 @@ export default class PrometheusGraph extends Base { render() { if (!this.state || !this.state.data) { return
- {this.props.title} + {/* {this.props.title} */}
Pending...
; } return this.state.data &&
-
{this.props.title}
+ {/*
{this.props.title}
*/} { /> [ + {title: 'Time', value: new Date(d[0].x * 1000).toLocaleTimeString()}, + {title: 'Percent', value: `${(d[0].y * 100).toFixed(2)}%`}, + ] + } className={'test-class-name'} />