mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-03-04 05:55:56 +01:00
fix: separate polar plot metric list from job.footprint return
This commit is contained in:
parent
f43379f365
commit
c25b076ca9
@ -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)
|
||||
*/
|
||||
</script>
|
||||
|
||||
@ -205,7 +212,7 @@
|
||||
{#if showFootprintTab}
|
||||
<TabPane tabId="foot" tab="Footprint" active>
|
||||
<CardBody>
|
||||
{#each footprintData as fpd, index}
|
||||
{#each jobFootprintData as fpd, index}
|
||||
{#if fpd.impact !== 4}
|
||||
<div class="mb-1 d-flex justify-content-between">
|
||||
<div> <b>{fpd.name} ({fpd.stat})</b></div>
|
||||
@ -246,7 +253,7 @@
|
||||
>{fpd.message}</Tooltip
|
||||
>
|
||||
</div>
|
||||
<Row cols={12} class="{(footprintData.length == (index + 1)) ? 'mb-0' : 'mb-2'}">
|
||||
<Row cols={12} class="{(jobFootprintData.length == (index + 1)) ? 'mb-0' : 'mb-2'}">
|
||||
{#if fpd.dir}
|
||||
<Col xs="1">
|
||||
<Icon name="caret-left-fill" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user