diff --git a/web/frontend/src/job/JobSummary.svelte b/web/frontend/src/job/JobSummary.svelte index 9b91f34..b4436fe 100644 --- a/web/frontend/src/job/JobSummary.svelte +++ b/web/frontend/src/job/JobSummary.svelte @@ -30,18 +30,25 @@ export let height = "400px"; const ccconfig = getContext("cc-config") + const globalMetrics = getContext("globalMetrics") const showFootprintTab = !!ccconfig[`job_view_showFootprint`]; - const polarMetrics = job?.footprint?.map((jf) => { - const fmt = findJobFootprintThresholds(job, jf.stat, getContext("getMetricConfig")(job.cluster, job.subCluster, jf.name)); - // If no matching metric config: Metric will be omitted in polar - return { - name: jf.name, - peak: fmt ? fmt.peak : null - } - }) + // Metrics Configured To Be Footprints For (sub)Cluster + const clusterFootprintMetrics = getContext("clusters") + .find((c) => c.name == job.cluster)?.subClusters + .find((sc) => sc.name == job.subCluster)?.footprint || [] - const footprintData = !showFootprintTab ? null : job?.footprint?.map((jf) => { + // Data For Polarplot Will Be Calculated Based On JobMetrics And Thresholds + const polarMetrics = globalMetrics.reduce((pms, gm) => { + if (clusterFootprintMetrics.includes(gm.name)) { + const fmt = findJobFootprintThresholds(job, gm.footprint, getContext("getMetricConfig")(job.cluster, job.subCluster, gm.name)); + pms.push({ name: gm.name, peak: fmt ? fmt.peak : null }); + } + return pms; + }, []) + + // Prepare Job Footprint Data Based On Values Saved In Database + const jobFootprintData = !showFootprintTab ? null : job?.footprint?.map((jf) => { const fmc = getContext("getMetricConfig")(job.cluster, job.subCluster, jf.name); if (fmc) { // Unit @@ -196,7 +203,7 @@ return res; }; - $: summaryMessages = writeSummary(footprintData) + $: summaryMessages = writeSummary(jobFootprintData) */ @@ -205,7 +212,7 @@ {#if showFootprintTab} - {#each footprintData as fpd, index} + {#each jobFootprintData as fpd, index} {#if fpd.impact !== 4}
 {fpd.name} ({fpd.stat})
@@ -246,7 +253,7 @@ >{fpd.message}
- + {#if fpd.dir}