mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 21:39:06 +01:00
fix selection, add zero default
This commit is contained in:
parent
ead5c54bcb
commit
78494cd30e
@ -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();
|
||||||
|
@ -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}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user