fix disabled-false-positives, add info if no metrics selected

This commit is contained in:
Christoph Kluge
2026-02-02 10:38:05 +01:00
parent b7bd8210e5
commit f2285e603b
4 changed files with 45 additions and 39 deletions

View File

@@ -32,7 +32,7 @@
let { let {
matchedListJobs = $bindable(0), matchedListJobs = $bindable(0),
selectedJobs = $bindable([]), selectedJobs = $bindable([]),
metrics = getContext("cc-config").metricConfig_jobListMetrics, metrics = [],
sorting = { field: "startTime", type: "col", order: "DESC" }, sorting = { field: "startTime", type: "col", order: "DESC" },
showFootprint = false, showFootprint = false,
filterBuffer = [], filterBuffer = [],
@@ -109,7 +109,7 @@
let paging = $derived({ itemsPerPage, page }); let paging = $derived({ itemsPerPage, page });
const plotWidth = $derived.by(() => { const plotWidth = $derived.by(() => {
return Math.floor( return Math.floor(
(tableWidth - jobInfoColumnWidth) / (metrics.length + (showFootprint ? 1 : 0)) - 10, (tableWidth - jobInfoColumnWidth) / (metrics.length + (showFootprint ? 2 : 1)) - 10,
); );
}); });
let jobsStore = $derived(queryStore({ let jobsStore = $derived(queryStore({

View File

@@ -133,7 +133,7 @@
} }
</script> </script>
<Card class="mt-1 overflow-auto" style="width: {width}; height: {height}"> <Card class="mx-2 overflow-auto" style="width: {width}; height: {height}">
{#if displayTitle} {#if displayTitle}
<CardHeader> <CardHeader>
<CardTitle class="mb-0 d-flex justify-content-center"> <CardTitle class="mb-0 d-flex justify-content-center">

View File

@@ -79,6 +79,7 @@
/* Derived */ /* Derived */
const jobId = $derived(job?.id); const jobId = $derived(job?.id);
const refinedData = $derived($metricsQuery?.data?.jobMetrics ? sortAndSelectScope($metricsQuery.data.jobMetrics) : []);
const scopes = $derived.by(() => { const scopes = $derived.by(() => {
if (job.numNodes == 1) { if (job.numNodes == 1) {
if (job.numAcc >= 1) return ["core", "accelerator"]; if (job.numAcc >= 1) return ["core", "accelerator"];
@@ -202,10 +203,15 @@
/> />
</td> </td>
{/if} {/if}
{#each sortAndSelectScope($metricsQuery.data.jobMetrics) as metric, i (metric?.name || i)} {#each refinedData as metric, i (metric?.name || i)}
<td> <td>
<!-- Subluster Metricconfig remove keyword for jobtables (joblist main, user joblist, project joblist) to be used here as toplevel case--> {#key metric}
{#if metric.disabled == false && metric.data} {#if metric?.data}
{#if metric?.disabled}
<Card body class="mx-2" color="info">
Metric <b>{metric.data.name}</b>: Disabled for subcluster <code>{job.subCluster}</code>
</Card>
{:else}
<MetricPlot <MetricPlot
onZoom={(detail) => handleZoom(detail, metric.data.name)} onZoom={(detail) => handleZoom(detail, metric.data.name)}
height={plotHeight} height={plotHeight}
@@ -222,12 +228,7 @@
zoomState={zoomStates[metric.data.name] || null} zoomState={zoomStates[metric.data.name] || null}
thresholdState={thresholdStates[metric.data.name] || null} thresholdState={thresholdStates[metric.data.name] || null}
/> />
{:else if metric.disabled == true && metric.data} {/if}
<Card body color="info"
>Metric disabled for subcluster <code
>{metric.data.name}:{job.subCluster}</code
></Card
>
{:else} {:else}
<Card body class="mx-2" color="warning"> <Card body class="mx-2" color="warning">
<p>No dataset(s) returned for <b>{metrics[i]}</b></p> <p>No dataset(s) returned for <b>{metrics[i]}</b></p>
@@ -236,6 +237,11 @@
<p class="mb-1">Identical messages in <i>job {job.jobId} row</i>: Host not found.</p> <p class="mb-1">Identical messages in <i>job {job.jobId} row</i>: Host not found.</p>
</Card> </Card>
{/if} {/if}
{/key}
</td>
{:else}
<td>
<Card body class="mx-2">No metrics selected for display.</Card>
</td> </td>
{/each} {/each}
{/if} {/if}

View File

@@ -69,9 +69,9 @@
}) })
); );
let extendedLegendData = $derived($nodeJobsData?.data ? buildExtendedLegend() : null); const extendedLegendData = $derived($nodeJobsData?.data ? buildExtendedLegend() : null);
let refinedData = $derived(nodeData?.metrics ? sortAndSelectScope(nodeData.metrics) : null); const refinedData = $derived(nodeData?.metrics ? sortAndSelectScope(nodeData.metrics) : []);
let dataHealth = $derived(refinedData.filter((rd) => rd.disabled === false).map((enabled) => (enabled?.data?.metric?.series?.length > 0))); const dataHealth = $derived(refinedData.filter((rd) => rd.disabled === false).map((enabled) => (enabled?.data?.metric?.series?.length > 0)));
/* Functions */ /* Functions */
const selectScope = (nodeMetrics) => const selectScope = (nodeMetrics) =>