@@ -147,35 +147,37 @@ export class ESRabComplexMetricsModel extends ComplexMetricsModel {
147147 this . yRightTwoAxisTickFormatting = yRightTwoAxisTickFormatting ;
148148 }
149149
150- getAllMetrics ( ) : void {
150+ getAllMetrics ( onlyActivated : boolean = true ) : void {
151151 for ( let metric of this . allMetricsFields . fieldsList ) {
152- this . monitoringService
153- . getAllMetrics ( this . monitoringIndex , metric , undefined , this . startDate , this . endDate )
154- . subscribe ( ( data : LineChartMetricModel [ ] ) => {
155- switch ( metric . unit ) {
156- case this . rightChartOneChartUnit :
157- this . rightChartOneAllData = this . rightChartOneAllData . concat ( data ) ;
158- if ( metric . activated ) {
159- this . rightChartOne = this . rightChartOne . concat ( data ) ;
160- }
161- break ;
162- case this . leftChartUnit :
163- this . leftChartAllData = this . leftChartAllData . concat ( data ) ;
164- if ( metric . activated ) {
165- this . leftChart = this . leftChart . concat ( data ) ;
166- }
167- break ;
168- case this . rightChartTwoChartUnit :
169- this . rightChartTwoAllData = this . rightChartTwoAllData . concat ( data ) ;
170- if ( metric . activated ) {
171- this . rightChartTwo = this . rightChartTwo . concat ( data ) ;
172- }
173- break ;
174- default :
175- break ;
176- }
177- } ) ;
178- // }
152+ if ( ! onlyActivated || ( onlyActivated && metric . activated ) ) {
153+ this . monitoringService
154+ . getAllMetrics ( this . monitoringIndex , metric , undefined , this . startDate , this . endDate )
155+ . subscribe ( ( data : LineChartMetricModel [ ] ) => {
156+ switch ( metric . unit ) {
157+ case this . rightChartOneChartUnit :
158+ this . rightChartOneAllData = this . rightChartOneAllData . concat ( data ) ;
159+ if ( metric . activated ) {
160+ this . rightChartOne = this . rightChartOne . concat ( data ) ;
161+ }
162+ break ;
163+ case this . leftChartUnit :
164+ this . leftChartAllData = this . leftChartAllData . concat ( data ) ;
165+ if ( metric . activated ) {
166+ this . leftChart = this . leftChart . concat ( data ) ;
167+ }
168+ break ;
169+ case this . rightChartTwoChartUnit :
170+ this . rightChartTwoAllData = this . rightChartTwoAllData . concat ( data ) ;
171+ if ( metric . activated ) {
172+ this . rightChartTwo = this . rightChartTwo . concat ( data ) ;
173+ }
174+ break ;
175+ default :
176+ break ;
177+ }
178+ } ) ;
179+ // }
180+ }
179181 }
180182 }
181183
0 commit comments