Merge pull request #133 from ClusterCockpit/hotfix

Hotfix
This commit is contained in:
Jan Eitzinger 2023-06-13 17:22:30 +02:00 committed by GitHub
commit 59008ec013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -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>

View File

@ -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