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";
|
export let height = "400px";
|
||||||
|
|
||||||
const ccconfig = getContext("cc-config")
|
const ccconfig = getContext("cc-config")
|
||||||
|
const globalMetrics = getContext("globalMetrics")
|
||||||
const showFootprintTab = !!ccconfig[`job_view_showFootprint`];
|
const showFootprintTab = !!ccconfig[`job_view_showFootprint`];
|
||||||
|
|
||||||
const polarMetrics = job?.footprint?.map((jf) => {
|
// Metrics Configured To Be Footprints For (sub)Cluster
|
||||||
const fmt = findJobFootprintThresholds(job, jf.stat, getContext("getMetricConfig")(job.cluster, job.subCluster, jf.name));
|
const clusterFootprintMetrics = getContext("clusters")
|
||||||
// If no matching metric config: Metric will be omitted in polar
|
.find((c) => c.name == job.cluster)?.subClusters
|
||||||
return {
|
.find((sc) => sc.name == job.subCluster)?.footprint || []
|
||||||
name: jf.name,
|
|
||||||
peak: fmt ? fmt.peak : null
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
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);
|
const fmc = getContext("getMetricConfig")(job.cluster, job.subCluster, jf.name);
|
||||||
if (fmc) {
|
if (fmc) {
|
||||||
// Unit
|
// Unit
|
||||||
@ -196,7 +203,7 @@
|
|||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
|
|
||||||
$: summaryMessages = writeSummary(footprintData)
|
$: summaryMessages = writeSummary(jobFootprintData)
|
||||||
*/
|
*/
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -205,7 +212,7 @@
|
|||||||
{#if showFootprintTab}
|
{#if showFootprintTab}
|
||||||
<TabPane tabId="foot" tab="Footprint" active>
|
<TabPane tabId="foot" tab="Footprint" active>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
{#each footprintData as fpd, index}
|
{#each jobFootprintData as fpd, index}
|
||||||
{#if fpd.impact !== 4}
|
{#if fpd.impact !== 4}
|
||||||
<div class="mb-1 d-flex justify-content-between">
|
<div class="mb-1 d-flex justify-content-between">
|
||||||
<div> <b>{fpd.name} ({fpd.stat})</b></div>
|
<div> <b>{fpd.name} ({fpd.stat})</b></div>
|
||||||
@ -246,7 +253,7 @@
|
|||||||
>{fpd.message}</Tooltip
|
>{fpd.message}</Tooltip
|
||||||
>
|
>
|
||||||
</div>
|
</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}
|
{#if fpd.dir}
|
||||||
<Col xs="1">
|
<Col xs="1">
|
||||||
<Icon name="caret-left-fill" />
|
<Icon name="caret-left-fill" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user