Browse Source

improves timeseries naming for moving average series

carl bergquist 10 years ago
parent
commit
0644bfe27c
1 changed files with 4 additions and 1 deletions
  1. 4 1
      public/app/plugins/datasource/elasticsearch/elastic_response.js

+ 4 - 1
public/app/plugins/datasource/elasticsearch/elastic_response.js

@@ -197,7 +197,10 @@ function (_, queryDef) {
       });
     }
 
-    if (series.field) {
+    if (series.field && series.metric === 'moving_avg') {
+      var appliedAgg = _.findWhere(target.metrics, { id: series.field });
+      metricName += ' ' + queryDef.describeMetric(appliedAgg);
+    } else if (series.field) {
       metricName += ' ' + series.field;
     }