mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-10 08:57:25 +01:00
commit
59008ec013
@ -18,9 +18,9 @@
|
||||
|
||||
let selectedHost = null, plot, fetching = false, error = null
|
||||
let selectedScope = minScope(scopes)
|
||||
let selectedScopeIndex = scopes.findIndex(s => s == selectedScope)
|
||||
|
||||
$: avaliableScopes = scopes
|
||||
$: availableScopes = scopes
|
||||
$: selectedScopeIndex = scopes.findIndex(s => s == selectedScope)
|
||||
$: data = rawData[selectedScopeIndex]
|
||||
$: series = data?.series.filter(series => selectedHost == null || series.hostname == selectedHost)
|
||||
|
||||
@ -43,11 +43,11 @@
|
||||
|
||||
for (let jm of response.data.jobMetrics) {
|
||||
if (jm.scope != "node") {
|
||||
scopes.push(jm.metric)
|
||||
scopes = [...scopes, jm.scope]
|
||||
rawData.push(jm.metric)
|
||||
selectedScope = jm.scope
|
||||
selectedScopeIndex = scopes.findIndex(s => s == jm.scope)
|
||||
dispatch('more-loaded', jm)
|
||||
if (!avaliableScopes.includes(selectedScope))
|
||||
avaliableScopes = [...avaliableScopes, selectedScope]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -60,10 +60,10 @@
|
||||
(metricConfig?.unit?.base ? metricConfig.unit.base : '')})
|
||||
</InputGroupText>
|
||||
<select class="form-select" bind:value={selectedScope}>
|
||||
{#each avaliableScopes as scope}
|
||||
{#each availableScopes as scope}
|
||||
<option value={scope}>{scope}</option>
|
||||
{/each}
|
||||
{#if avaliableScopes.length == 1 && metricConfig?.scope != "node"}
|
||||
{#if availableScopes.length == 1 && metricConfig?.scope != "node"}
|
||||
<option value={"load-more"}>Load more...</option>
|
||||
{/if}
|
||||
</select>
|
||||
|
@ -279,8 +279,8 @@
|
||||
export function transformPerNodeData(nodes) {
|
||||
const x = [], y = [], c = []
|
||||
for (let node of nodes) {
|
||||
let flopsAny = node.metrics.find(m => m.name == 'flops_any' && m.metric.scope == 'node')?.metric
|
||||
let memBw = node.metrics.find(m => m.name == 'mem_bw' && m.metric.scope == 'node')?.metric
|
||||
let flopsAny = node.metrics.find(m => m.name == 'flops_any' && m.scope == 'node')?.metric
|
||||
let memBw = node.metrics.find(m => m.name == 'mem_bw' && m.scope == 'node')?.metric
|
||||
if (!flopsAny || !memBw) {
|
||||
console.warn("transformPerNodeData: metrics for 'mem_bw' and/or 'flops_any' missing!")
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user