fix: load jobView roofline on finest resolution separately by default, see #339

This commit is contained in:
Christoph Kluge 2025-02-17 18:24:28 +01:00
parent 1b043838ea
commit 58e678d72c
3 changed files with 28 additions and 8 deletions

View File

@ -644,7 +644,7 @@ func (ccms *CCMetricStore) LoadNodeData(
req.Queries = append(req.Queries, ApiQuery{ req.Queries = append(req.Queries, ApiQuery{
Hostname: node, Hostname: node,
Metric: ccms.toRemoteName(metric), Metric: ccms.toRemoteName(metric),
Resolution: 60, // Default for Node Queries Resolution: 0, // Default for Node Queries: Will return metric $Timestep Resolution
}) })
} }
} }

View File

@ -117,20 +117,39 @@
} }
`; `;
const roofQuery = gql`
query ($dbid: ID!, $selectedMetrics: [String!]!, $selectedScopes: [MetricScope!]!, $selectedResolution: Int) {
jobMetrics(id: $dbid, metrics: $selectedMetrics, scopes: $selectedScopes, resolution: $selectedResolution) {
name
scope
metric {
series {
data
}
}
}
}
`;
$: jobMetrics = queryStore({ $: jobMetrics = queryStore({
client: client, client: client,
query: query, query: query,
variables: { dbid, selectedMetrics, selectedScopes }, variables: { dbid, selectedMetrics, selectedScopes },
}); });
// Roofline: Always load roofMetrics with configured timestep (Resolution: 0)
$: roofMetrics = queryStore({
client: client,
query: roofQuery,
variables: { dbid, selectedMetrics: ["flops_any", "mem_bw"], selectedScopes: ["node"], selectedResolution: 0 },
});
// Handle Job Query on Init -> is not executed anymore // Handle Job Query on Init -> is not executed anymore
getContext("on-init")(() => { getContext("on-init")(() => {
let job = $initq.data.job; let job = $initq.data.job;
if (!job) return; if (!job) return;
const pendingMetrics = [ const pendingMetrics = [
"flops_any",
"mem_bw",
...(ccconfig[`job_view_selectedMetrics:${job.cluster}`] || ...(ccconfig[`job_view_selectedMetrics:${job.cluster}`] ||
$initq.data.globalMetrics.reduce((names, gm) => { $initq.data.globalMetrics.reduce((names, gm) => {
if (gm.availability.find((av) => av.cluster === job.cluster)) { if (gm.availability.find((av) => av.cluster === job.cluster)) {
@ -276,12 +295,12 @@
<!-- Column 3: Job Roofline; If footprint Enabled: full width, else half width --> <!-- Column 3: Job Roofline; If footprint Enabled: full width, else half width -->
<Col xs={12} md={12} xl={5} xxl={6}> <Col xs={12} md={12} xl={5} xxl={6}>
{#if $initq.error || $jobMetrics.error} {#if $initq.error || $roofMetrics.error}
<Card body color="danger"> <Card body color="danger">
<p>Initq Error: {$initq.error?.message}</p> <p>Initq Error: {$initq.error?.message}</p>
<p>jobMetrics Error: {$jobMetrics.error?.message}</p> <p>roofMetrics (jobMetrics) Error: {$roofMetrics.error?.message}</p>
</Card> </Card>
{:else if $initq?.data && $jobMetrics?.data} {:else if $initq?.data && $roofMetrics?.data}
<Card style="height: 400px;"> <Card style="height: 400px;">
<div bind:clientWidth={roofWidth}> <div bind:clientWidth={roofWidth}>
<Roofline <Roofline
@ -292,10 +311,10 @@
.find((c) => c.name == $initq.data.job.cluster) .find((c) => c.name == $initq.data.job.cluster)
.subClusters.find((sc) => sc.name == $initq.data.job.subCluster)} .subClusters.find((sc) => sc.name == $initq.data.job.subCluster)}
data={transformDataForRoofline( data={transformDataForRoofline(
$jobMetrics.data?.jobMetrics?.find( $roofMetrics.data?.jobMetrics?.find(
(m) => m.name == "flops_any" && m.scope == "node", (m) => m.name == "flops_any" && m.scope == "node",
)?.metric, )?.metric,
$jobMetrics.data?.jobMetrics?.find( $roofMetrics.data?.jobMetrics?.find(
(m) => m.name == "mem_bw" && m.scope == "node", (m) => m.name == "mem_bw" && m.scope == "node",
)?.metric, )?.metric,
)} )}

View File

@ -80,6 +80,7 @@
: ccconfig.user_view_histogramMetrics || []; : ccconfig.user_view_histogramMetrics || [];
const client = getContextClient(); const client = getContextClient();
// Note: nodeMetrics are requested on configured $timestep resolution
$: mainQuery = queryStore({ $: mainQuery = queryStore({
client: client, client: client,
query: gql` query: gql`