diff --git a/web/frontend/src/Status.root.svelte b/web/frontend/src/Status.root.svelte index 2b57bfa..8dcc82e 100644 --- a/web/frontend/src/Status.root.svelte +++ b/web/frontend/src/Status.root.svelte @@ -4,6 +4,7 @@ import Histogram from './plots/Histogram.svelte' import { Row, Col, Spinner, Card, CardHeader, CardTitle, CardBody, Table, Progress, Icon } from 'sveltestrap' import { init } from './utils.js' + import { scaleNumbers } from './units.js' import { queryStore, gql, getContextClient } from '@urql/svelte' const { query: initq } = init() @@ -50,15 +51,17 @@ ? sum + (node.metrics.find(m => m.name == metric)?.metric.series.reduce((sum, series) => sum + series.data[series.data.length - 1], 0) || 0) : sum, 0) - let allocatedNodes = {}, flopRate = {}, flopRateUnit = {}, memBwRate = {}, memBwRateUnit = {} + let allocatedNodes = {}, flopRate = {}, flopRateUnitPrefix = {}, flopRateUnitBase = {}, memBwRate = {}, memBwRateUnitPrefix = {}, memBwRateUnitBase = {} $: if ($initq.data && $mainQuery.data) { let subClusters = $initq.data.clusters.find(c => c.name == cluster).subClusters for (let subCluster of subClusters) { - allocatedNodes[subCluster.name] = $mainQuery.data.allocatedNodes.find(({ name }) => name == subCluster.name)?.count || 0 - flopRate[subCluster.name] = Math.floor(sumUp($mainQuery.data.nodeMetrics, subCluster.name, 'flops_any') * 100) / 100 - flopRateUnit[subCluster.name] = subCluster.flopRateSimd.unit.prefix + subCluster.flopRateSimd.unit.base - memBwRate[subCluster.name] = Math.floor(sumUp($mainQuery.data.nodeMetrics, subCluster.name, 'mem_bw') * 100) / 100 - memBwRateUnit[subCluster.name] = subCluster.memoryBandwidth.unit.prefix + subCluster.memoryBandwidth.unit.base + allocatedNodes[subCluster.name] = $mainQuery.data.allocatedNodes.find(({ name }) => name == subCluster.name)?.count || 0 + flopRate[subCluster.name] = Math.floor(sumUp($mainQuery.data.nodeMetrics, subCluster.name, 'flops_any') * 100) / 100 + flopRateUnitPrefix[subCluster.name] = subCluster.flopRateSimd.unit.prefix + flopRateUnitBase[subCluster.name] = subCluster.flopRateSimd.unit.base + memBwRate[subCluster.name] = Math.floor(sumUp($mainQuery.data.nodeMetrics, subCluster.name, 'mem_bw') * 100) / 100 + memBwRateUnitPrefix[subCluster.name] = subCluster.memoryBandwidth.unit.prefix + memBwRateUnitBase[subCluster.name] = subCluster.memoryBandwidth.unit.base } } @@ -116,12 +119,22 @@