mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 04:51:39 +02:00
Prototype completed
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
const { query: initq } = init()
|
||||
|
||||
const ccconfig = getContext('cc-config')
|
||||
// const metricConfig = getContext('metrics')
|
||||
|
||||
export let user
|
||||
export let filterPresets
|
||||
@@ -42,7 +41,7 @@
|
||||
totalCoreHours
|
||||
histDuration { count, value }
|
||||
histNumNodes { count, value }
|
||||
histMetrics { metric, data { min, max, count, bin } }
|
||||
histMetrics { metric, unit, data { min, max, count, bin } }
|
||||
}}`,
|
||||
variables: { jobFilters, metricsInHistograms}
|
||||
})
|
||||
@@ -185,21 +184,18 @@
|
||||
<PlotTable
|
||||
let:item
|
||||
let:width
|
||||
renderFor="analysis"
|
||||
items={$stats.data.jobsStatistics[0].histMetrics}>
|
||||
renderFor="user"
|
||||
items={$stats.data.jobsStatistics[0].histMetrics}
|
||||
itemsPerRow={3}>
|
||||
|
||||
{item}
|
||||
|
||||
<!-- <Histogram
|
||||
data={convert2uplot(item.bins)}
|
||||
<Histogram
|
||||
data={convert2uplot(item.data)}
|
||||
width={width} height={250}
|
||||
title="Average Distribution of '{item.metric}'"
|
||||
xlabel={`${item.metric} bin maximum [${(metricConfig(selectedCluster, item.metric)?.unit?.prefix ? metricConfig(selectedCluster, item.metric)?.unit?.prefix : '') +
|
||||
(metricConfig(selectedCluster, item.metric)?.unit?.base ? metricConfig(selectedCluster, item.metric)?.unit?.base : '')}]`}
|
||||
xunit={`${(metricConfig(selectedCluster, item.metric)?.unit?.prefix ? metricConfig(selectedCluster, item.metric)?.unit?.prefix : '') +
|
||||
(metricConfig(selectedCluster, item.metric)?.unit?.base ? metricConfig(selectedCluster, item.metric)?.unit?.base : '')}`}
|
||||
ylabel="Normalized Hours"
|
||||
yunit="Hours"/> -->
|
||||
title="Distribution of '{item.metric}'"
|
||||
xlabel={`${item.metric} bin maximum [${item.unit}]`}
|
||||
xunit={item.unit}
|
||||
ylabel="Count"
|
||||
yunit="Jobs"/>
|
||||
</PlotTable>
|
||||
{/key}
|
||||
</Col>
|
||||
|
@@ -318,9 +318,14 @@ export function checkMetricDisabled(m, c, s) { //[m]etric, [c]luster, [s]ubclust
|
||||
export function convert2uplot(canvasData) {
|
||||
// initial use: Canvas Histogram Data to Uplot
|
||||
let uplotData = [[],[]] // [X, Y1, Y2, ...]
|
||||
canvasData.forEach( pair => {
|
||||
uplotData[0].push(pair.value)
|
||||
uplotData[1].push(pair.count)
|
||||
canvasData.forEach( cd => {
|
||||
if (cd.bin) { // MetricHisto Datafromat
|
||||
uplotData[0].push(cd.max)
|
||||
uplotData[1].push(cd.count)
|
||||
} else { // Default
|
||||
uplotData[0].push(cd.value)
|
||||
uplotData[1].push(cd.count)
|
||||
}
|
||||
})
|
||||
return uplotData
|
||||
}
|
||||
|
Reference in New Issue
Block a user