mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 04:51:39 +02:00
Add metrics to histoselect, add userfilters
- edit struct to make only count return required
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
import { gql, getContextClient , mutationStore } from '@urql/svelte'
|
||||
|
||||
export let cluster
|
||||
export let availableMetrics = ['cpu_load', 'flops_any', 'mem_bw']
|
||||
export let metricsInHistograms
|
||||
export let isOpen
|
||||
|
||||
let availableMetrics = ['cpu_load', 'flops_any', 'mem_used', 'mem_bw', 'net_bw', 'file_bw']
|
||||
let pendingMetrics = [...metricsInHistograms] // Copy
|
||||
const client = getContextClient()
|
||||
|
||||
|
@@ -44,7 +44,7 @@
|
||||
histNumNodes { count, value }
|
||||
histMetrics { metric, unit, data { min, max, count, bin } }
|
||||
}}`,
|
||||
variables: { jobFilters, metricsInHistograms}
|
||||
variables: { jobFilters, metricsInHistograms }
|
||||
})
|
||||
|
||||
onMount(() => filterComponent.update())
|
||||
|
@@ -316,16 +316,18 @@ export function checkMetricDisabled(m, c, s) { //[m]etric, [c]luster, [s]ubclust
|
||||
}
|
||||
|
||||
export function convert2uplot(canvasData) {
|
||||
// initial use: Canvas Histogram Data to Uplot
|
||||
// Prep: Uplot Data Structure
|
||||
let uplotData = [[],[]] // [X, Y1, Y2, ...]
|
||||
// MetricHisto Only: Check if 1st bin not-null -> Set 0-Value bin for scaling
|
||||
// Else: Only Single 0-Value bin returned -> No reset required
|
||||
if (canvasData[0]?.bin) {
|
||||
uplotData[0].push(0)
|
||||
uplotData[1].push(0)
|
||||
}
|
||||
// Iterate
|
||||
canvasData.forEach( cd => {
|
||||
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)
|
||||
if (Object.keys(cd).length == 4) { // MetricHisto Datafromat
|
||||
uplotData[0].push(cd?.max ? cd.max : 0)
|
||||
uplotData[1].push(cd.count)
|
||||
} else { // Default
|
||||
uplotData[0].push(cd.value)
|
||||
|
Reference in New Issue
Block a user