Browse Source

fix

merge-requests/3/head
vargburz 2 years ago
parent
commit
1580a501d5
  1. 8
      src/models/series.ts

8
src/models/series.ts

@ -19,14 +19,14 @@ export class Series {
if(this.gaugeValueOptions.useMetric && _.isEmpty(this.gaugeValueOptions.metricName)) { if(this.gaugeValueOptions.useMetric && _.isEmpty(this.gaugeValueOptions.metricName)) {
throw new Error(`Value or metric is not selected.`); throw new Error(`Value or metric is not selected.`);
} }
this._selectedSerieName = this.gaugeValueOptions.metricName; this._selectedSerieName = this.gaugeValueOptions.metricName;
this.processor = new DataProcessor({}); this.processor = new DataProcessor({});
const series = grafanaData.series;
const seriesList = this.processor.getSeriesList({ const seriesList = this.processor.getSeriesList({
dataList: series, dataList: grafanaData.series,
range: timeRange, range: timeRange,
}); });
console.log('_seriesList', seriesList);
const filteredSeries = _.filter(seriesList, serie => serie.alias === this._selectedSerieName); const filteredSeries = _.filter(seriesList, serie => serie.alias === this._selectedSerieName);
if(filteredSeries.length === 0) { if(filteredSeries.length === 0) {
throw new Error(`Can't find metric for ${this._selectedSerieName} name`); throw new Error(`Can't find metric for ${this._selectedSerieName} name`);
@ -34,7 +34,7 @@ export class Series {
if(filteredSeries.length > 1) { if(filteredSeries.length > 1) {
throw new Error(`Get ${filteredSeries.length} metrics for ${this._selectedSerieName} name. Please choose one`); throw new Error(`Get ${filteredSeries.length} metrics for ${this._selectedSerieName} name. Please choose one`);
} }
console.log('filteredSeries', filteredSeries);
this._seriesList = this._updateSeriesListWithChartwerkParams(filteredSeries); this._seriesList = this._updateSeriesListWithChartwerkParams(filteredSeries);
} }

Loading…
Cancel
Save