From 88c336591b8efe04a017106bf2e9032f1900aee1 Mon Sep 17 00:00:00 2001 From: git-ryyamauc Date: Tue, 15 Aug 2023 12:56:50 +0900 Subject: [PATCH] Fixed bugs in sum/avg of sliding window --- .../components/alert-details/alert-details.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/alerts/components/alert-details/alert-details.component.ts b/frontend/src/app/alerts/components/alert-details/alert-details.component.ts index c67a30504..9b2c281c4 100644 --- a/frontend/src/app/alerts/components/alert-details/alert-details.component.ts +++ b/frontend/src/app/alerts/components/alert-details/alert-details.component.ts @@ -1330,8 +1330,10 @@ export class AlertDetailsComponent implements OnInit, OnDestroy, AfterContentIni const query: any = JSON.parse(JSON.stringify(this.queries[i])); if ( fx ) { for ( let j =0; j < query.metrics.length; j++ ) { - query.metrics[j].functions = query.metrics[j].functions || []; - query.metrics[j].functions.push(fx); + if ( query.metrics[j].id === this.thresholdSingleMetricControls.metricId.value ) { + query.metrics[j].functions = query.metrics[j].functions || []; + query.metrics[j].functions.push(fx); + } } } if (query.namespace && query.metrics.length) {