fix selection, add zero default

This commit is contained in:
Christoph Kluge 2023-12-05 17:33:30 +01:00
parent ead5c54bcb
commit 78494cd30e
3 changed files with 7 additions and 3 deletions

View File

@ -4,7 +4,7 @@
import { gql, getContextClient , mutationStore } from '@urql/svelte' import { gql, getContextClient , mutationStore } from '@urql/svelte'
export let cluster export let cluster
export let availableMetrics export let availableMetrics = ['cpu_load', 'flops_any', 'mem_bw']
export let metricsInHistograms export let metricsInHistograms
const client = getContextClient(); const client = getContextClient();

View File

@ -75,7 +75,6 @@
<HistogramSelection <HistogramSelection
bind:cluster={selectedCluster} bind:cluster={selectedCluster}
bind:availableMetrics={metrics}
bind:metricsInHistograms={metricsInHistograms}/> bind:metricsInHistograms={metricsInHistograms}/>
</Col> </Col>
<Col xs="auto"> <Col xs="auto">
@ -194,7 +193,7 @@
title="Distribution of '{item.metric}'" title="Distribution of '{item.metric}'"
xlabel={`${item.metric} bin maximum [${item.unit}]`} xlabel={`${item.metric} bin maximum [${item.unit}]`}
xunit={item.unit} xunit={item.unit}
ylabel="Count" ylabel="Count [Jobs]"
yunit="Jobs"/> yunit="Jobs"/>
</PlotTable> </PlotTable>
{/key} {/key}

View File

@ -320,6 +320,11 @@ export function convert2uplot(canvasData) {
let uplotData = [[],[]] // [X, Y1, Y2, ...] let uplotData = [[],[]] // [X, Y1, Y2, ...]
canvasData.forEach( cd => { canvasData.forEach( cd => {
if (cd.bin) { // MetricHisto Datafromat if (cd.bin) { // MetricHisto Datafromat
// Force Zero Entry for scaling
if (uplotData[0].length == 0) {
uplotData[0].push(0)
uplotData[1].push(0)
}
uplotData[0].push(cd.max) uplotData[0].push(cd.max)
uplotData[1].push(cd.count) uplotData[1].push(cd.count)
} else { // Default } else { // Default