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