mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-03-04 14:05:56 +01:00
add metric selection count info to job view
This commit is contained in:
parent
1031b3eb79
commit
5ce03c2db3
@ -58,7 +58,8 @@
|
|||||||
let plots = {},
|
let plots = {},
|
||||||
statsTable
|
statsTable
|
||||||
|
|
||||||
let missingMetrics = [],
|
let availableMetrics = new Set(),
|
||||||
|
missingMetrics = [],
|
||||||
missingHosts = [],
|
missingHosts = [],
|
||||||
somethingMissing = false;
|
somethingMissing = false;
|
||||||
|
|
||||||
@ -293,7 +294,7 @@
|
|||||||
{#if $initq.data}
|
{#if $initq.data}
|
||||||
<Col xs="auto">
|
<Col xs="auto">
|
||||||
<Button outline on:click={() => (isMetricsSelectionOpen = true)} color="primary">
|
<Button outline on:click={() => (isMetricsSelectionOpen = true)} color="primary">
|
||||||
Select Metrics
|
Select Metrics (Selected {selectedMetrics.length} of {availableMetrics.size} available)
|
||||||
</Button>
|
</Button>
|
||||||
</Col>
|
</Col>
|
||||||
{/if}
|
{/if}
|
||||||
@ -431,6 +432,7 @@
|
|||||||
configName="job_view_selectedMetrics"
|
configName="job_view_selectedMetrics"
|
||||||
bind:metrics={selectedMetrics}
|
bind:metrics={selectedMetrics}
|
||||||
bind:isOpen={isMetricsSelectionOpen}
|
bind:isOpen={isMetricsSelectionOpen}
|
||||||
|
bind:allMetrics={availableMetrics}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
InputGroup,
|
InputGroup,
|
||||||
InputGroupText,
|
InputGroupText,
|
||||||
Icon,
|
Icon,
|
||||||
|
Row,
|
||||||
|
Col
|
||||||
} from "@sveltestrap/sveltestrap";
|
} from "@sveltestrap/sveltestrap";
|
||||||
import { maxScope } from "../generic/utils.js";
|
import { maxScope } from "../generic/utils.js";
|
||||||
import StatsTableEntry from "./StatsTableEntry.svelte";
|
import StatsTableEntry from "./StatsTableEntry.svelte";
|
||||||
@ -26,7 +28,7 @@
|
|||||||
export let job;
|
export let job;
|
||||||
export let jobMetrics;
|
export let jobMetrics;
|
||||||
|
|
||||||
const allMetrics = [...new Set(jobMetrics.map((m) => m.name))].sort()
|
const sortedJobMetrics = [...new Set(jobMetrics.map((m) => m.name))].sort()
|
||||||
const scopesForMetric = (metric) =>
|
const scopesForMetric = (metric) =>
|
||||||
jobMetrics.filter((jm) => jm.name == metric).map((jm) => jm.scope);
|
jobMetrics.filter((jm) => jm.name == metric).map((jm) => jm.scope);
|
||||||
|
|
||||||
@ -34,11 +36,12 @@
|
|||||||
selectedScopes = {},
|
selectedScopes = {},
|
||||||
sorting = {},
|
sorting = {},
|
||||||
isMetricSelectionOpen = false,
|
isMetricSelectionOpen = false,
|
||||||
|
availableMetrics = new Set(),
|
||||||
selectedMetrics =
|
selectedMetrics =
|
||||||
getContext("cc-config")[`job_view_nodestats_selectedMetrics:${job.cluster}`] ||
|
getContext("cc-config")[`job_view_nodestats_selectedMetrics:${job.cluster}`] ||
|
||||||
getContext("cc-config")["job_view_nodestats_selectedMetrics"];
|
getContext("cc-config")["job_view_nodestats_selectedMetrics"];
|
||||||
|
|
||||||
for (let metric of allMetrics) {
|
for (let metric of sortedJobMetrics) {
|
||||||
// Not Exclusive or Multi-Node: get maxScope directly (mostly: node)
|
// Not Exclusive or Multi-Node: get maxScope directly (mostly: node)
|
||||||
// -> Else: Load smallest available granularity as default as per availability
|
// -> Else: Load smallest available granularity as default as per availability
|
||||||
const availableScopes = scopesForMetric(metric);
|
const availableScopes = scopesForMetric(metric);
|
||||||
@ -95,15 +98,19 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<Row>
|
||||||
|
<Col class="m-2">
|
||||||
|
<Button outline on:click={() => (isMetricSelectionOpen = true)} class="w-auto px-2" color="primary">
|
||||||
|
Select Metrics (Selected {selectedMetrics.length} of {availableMetrics.size} available)
|
||||||
|
</Button>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<hr class="mb-1 mt-1"/>
|
||||||
<Table class="mb-0">
|
<Table class="mb-0">
|
||||||
<thead>
|
<thead>
|
||||||
<!-- Header Row 1: Selectors -->
|
<!-- Header Row 1: Selectors -->
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th/>
|
||||||
<Button outline on:click={() => (isMetricSelectionOpen = true)} class="w-100 px-2" color="primary">
|
|
||||||
Select Metrics
|
|
||||||
</Button>
|
|
||||||
</th>
|
|
||||||
{#each selectedMetrics as metric}
|
{#each selectedMetrics as metric}
|
||||||
<!-- To Match Row-2 Header Field Count-->
|
<!-- To Match Row-2 Header Field Count-->
|
||||||
<th colspan={selectedScopes[metric] == "node" ? 3 : 4}>
|
<th colspan={selectedScopes[metric] == "node" ? 3 : 4}>
|
||||||
@ -163,7 +170,7 @@
|
|||||||
<MetricSelection
|
<MetricSelection
|
||||||
cluster={job.cluster}
|
cluster={job.cluster}
|
||||||
configName="job_view_nodestats_selectedMetrics"
|
configName="job_view_nodestats_selectedMetrics"
|
||||||
allMetrics={new Set(allMetrics)}
|
bind:allMetrics={availableMetrics}
|
||||||
bind:metrics={selectedMetrics}
|
bind:metrics={selectedMetrics}
|
||||||
bind:isOpen={isMetricSelectionOpen}
|
bind:isOpen={isMetricSelectionOpen}
|
||||||
/>
|
/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user