You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by av...@apache.org on 2016/06/30 17:51:17 UTC

ambari git commit: AMBARI-17027: Metrics Collector API: Introduce basic series aggregation functions (Jungtaek Lim via avijayan)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 2fa199878 -> 1c29d347c


AMBARI-17027: Metrics Collector API: Introduce basic series aggregation functions (Jungtaek Lim via avijayan)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1c29d347
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1c29d347
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1c29d347

Branch: refs/heads/branch-2.4
Commit: 1c29d347c48f9e188942bed12a224bd5cbca7ce7
Parents: 2fa1998
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Thu Jun 30 10:51:08 2016 -0700
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Thu Jun 30 10:51:08 2016 -0700

----------------------------------------------------------------------
 .../ambari-metrics/datasource.js                | 22 +++++++++-----
 .../ambari-metrics/partials/query.editor.html   | 12 ++++++++
 .../ambari-metrics/queryCtrl.js                 |  8 ++++-
 .../timeline/HBaseTimelineMetricStore.java      | 32 ++++++++++++++++++--
 .../metrics/timeline/TimelineMetricStore.java   |  4 ++-
 .../timeline/TimelineMetricStoreWatcher.java    |  2 +-
 .../webapp/TimelineWebServices.java             |  8 +++--
 .../timeline/TestTimelineMetricStore.java       |  3 +-
 .../TimelineMetricStoreWatcherTest.java         |  5 +--
 9 files changed, 77 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1c29d347/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
index 6a4f01b..66043c5 100644
--- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
+++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
@@ -165,9 +165,10 @@ define([
             + target.precision;
             var metricAggregator = target.aggregator === "none" ? '' : '._' + target.aggregator;
             var metricTransform = !target.transform || target.transform === "none" ? '' : '._' + target.transform;
+            var seriesAggregator = !target.seriesAggregator || target.seriesAggregator === "none" ? '' : '&seriesAggregateFunction=' + target.seriesAggregator;
             return backendSrv.get(self.url + '/ws/v1/timeline/metrics?metricNames=' + target.metric + metricTransform +
                 metricAggregator + "&hostname=" + target.hosts + '&appId=' + target.app + '&startTime=' + from +
-                '&endTime=' + to + precision).then(
+                '&endTime=' + to + precision + seriesAggregator).then(
                 getMetricsData(target)
             );
           };
@@ -186,9 +187,10 @@ define([
             + target.precision;
             var metricAggregator = target.aggregator === "none" ? '' : '._' + target.aggregator;
             var metricTransform = !target.transform || target.transform === "none" ? '' : '._' + target.transform;
+            var seriesAggregator = !target.seriesAggregator || target.seriesAggregator === "none" ? '' : '&seriesAggregateFunction=' + target.seriesAggregator;
             return backendSrv.get(self.url + '/ws/v1/timeline/metrics?metricNames=' + target.metric + metricTransform
               + metricAggregator + '&hostname=' + tHost + '&appId=' + target.app + '&startTime=' + from +
-              '&endTime=' + to + precision).then(
+              '&endTime=' + to + precision + seriesAggregator).then(
               getMetricsData(target)
             );
           };
@@ -206,10 +208,11 @@ define([
               topN = '&topN=' + metricTopN[0].current.value  +'&topNFunction=' + metricTopAgg[0].current.value  + '&isBottomN='+ isBottomN;
             }
             var metricTransform = !target.transform || target.transform === "none" ? '' : '._' + target.transform;
+            var seriesAggregator = !target.seriesAggregator || target.seriesAggregator === "none" ? '' : '&seriesAggregateFunction=' + target.seriesAggregator;
             var templatedComponent = (_.isEmpty(tComponent)) ? target.app : tComponent;
             return backendSrv.get(self.url + '/ws/v1/timeline/metrics?metricNames=' + target.metric + metricTransform
               + metricAggregator + '&hostname=' + target.templatedHost + '&appId=' + templatedComponent + '&startTime=' + from +
-              '&endTime=' + to + precision + topN).then(
+              '&endTime=' + to + precision + topN + seriesAggregator).then(
               allHostMetricsData(target)
             );
           };
@@ -218,17 +221,19 @@ define([
             + target.precision;
             var metricAggregator = target.aggregator === "none" ? '' : '._' + target.aggregator;
             var metricTransform = !target.transform || target.transform === "none" ? '' : '._' + target.transform;
+            var seriesAggregator = !target.seriesAggregator || target.seriesAggregator === "none" ? '' : '&seriesAggregateFunction=' + target.seriesAggregator;
             return backendSrv.get(self.url + '/ws/v1/timeline/metrics?metricNames=' + target.queue + metricTransform
               + metricAggregator + '&appId=resourcemanager&startTime=' + from +
-              '&endTime=' + to + precision).then(
+              '&endTime=' + to + precision + seriesAggregator).then(
               getMetricsData(target)
             );
           };
           var getHbaseAppIdData = function(target) {
             var precision = target.precision === 'default' || typeof target.precision == 'undefined'  ? '' : '&precision='
             + target.precision;
+            var seriesAggregator = !target.seriesAggregator || target.seriesAggregator === "none" ? '' : '&seriesAggregateFunction=' + target.seriesAggregator;
             return backendSrv.get(self.url + '/ws/v1/timeline/metrics?metricNames=' + target.hbMetric + '&appId=hbase&startTime=' 
-            + from + '&endTime=' + to + precision).then(
+            + from + '&endTime=' + to + precision + seriesAggregator).then(
               allHostMetricsData(target)
             );
           };
@@ -238,9 +243,10 @@ define([
             + target.precision;
             var metricAggregator = target.aggregator === "none" ? '' : '._' + target.aggregator;
             var metricTransform = !target.transform || target.transform === "none" ? '' : '._' + target.transform;
+            var seriesAggregator = !target.seriesAggregator || target.seriesAggregator === "none" ? '' : '&seriesAggregateFunction=' + target.seriesAggregator;
             return backendSrv.get(self.url + '/ws/v1/timeline/metrics?metricNames=' + target.kbMetric + metricTransform
               + metricAggregator + '&appId=kafka_broker&startTime=' + from +
-              '&endTime=' + to + precision).then(
+              '&endTime=' + to + precision + seriesAggregator).then(
               getMetricsData(target)
             );
           };
@@ -249,8 +255,9 @@ define([
             + target.precision;
             var metricAggregator = target.aggregator === "none" ? '' : '._' + target.aggregator;
             var metricTransform = !target.transform || target.transform === "none" ? '' : '._' + target.transform;
+            var seriesAggregator = !target.seriesAggregator || target.seriesAggregator === "none" ? '' : '&seriesAggregateFunction=' + target.seriesAggregator;
             return backendSrv.get(self.url + '/ws/v1/timeline/metrics?metricNames=' + target.nnMetric + metricTransform
-            + metricAggregator + '&appId=namenode&startTime=' + from + '&endTime=' + to + precision).then(
+            + metricAggregator + '&appId=namenode&startTime=' + from + '&endTime=' + to + precision + seriesAggregator).then(
               allHostMetricsData(target)
             );
           };
@@ -672,6 +679,7 @@ define([
           ]);
           return aggregatorsPromise;
         };
+
         return AmbariMetricsDatasource;
       });
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1c29d347/ambari-metrics/ambari-metrics-grafana/ambari-metrics/partials/query.editor.html
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/partials/query.editor.html b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/partials/query.editor.html
index b034c03..3f322c1 100644
--- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/partials/query.editor.html
+++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/partials/query.editor.html
@@ -109,6 +109,7 @@
                 <i class="fa fa-warning"></i>
             </a>
         </li>
+
     </ul>
 
     <div class="clearfix"></div>
@@ -150,5 +151,16 @@
                     ng-change="targetBlur()">
             </select>
         </li>
+
+        <li class="tight-form-item">
+            Series Aggregator
+        </li>
+        <li>
+            <select ng-model="target.seriesAggregator" class="tight-form-input input-small"
+                    ng-options="seriesAggregator for seriesAggregator in seriesAggregators"
+                    ng-init="seriesAggregator()"
+                    ng-change="targetBlur()">
+            </select>
+        </li>
     <div class="clearfix"></div>
 </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/1c29d347/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
index 2eb3613..a26e7d0 100644
--- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
+++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
@@ -31,6 +31,7 @@ define([
           $scope.aggregators = ['none','avg', 'sum', 'min', 'max'];
           $scope.precisions = ['default','seconds', 'minutes', 'hours', 'days'];
           $scope.transforms = ['none','diff','rate'];
+          $scope.seriesAggregators = ['none', 'avg', 'sum', 'min', 'max'];
 
           if (!$scope.target.aggregator) {
             $scope.target.aggregator = 'avg';
@@ -45,6 +46,11 @@ define([
                 $scope.target.transform = "none";
            }
           };
+          $scope.seriesAggregator = function () {
+           if (typeof $scope.target.seriesAggregator == 'undefined') {
+                $scope.target.seriesAggregator = "none";
+           }
+          };
           $scope.$watch('target.app', function (newValue) {
             if (newValue === '') {
               $scope.target.metric = '';
@@ -144,4 +150,4 @@ define([
         $scope.init();
       });
 
-    });
\ No newline at end of file
+    });

http://git-wip-us.apache.org/repos/asf/ambari/blob/1c29d347/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
index f1e42e4..9510574 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
@@ -17,7 +17,6 @@
  */
 package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline;
 
-
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -36,6 +35,9 @@ import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.TimelineMetricAggregatorFactory;
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.discovery.TimelineMetricMetadataKey;
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.discovery.TimelineMetricMetadataManager;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.function.SeriesAggregateFunction;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.function.TimelineMetricsSeriesAggregateFunction;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.function.TimelineMetricsSeriesAggregateFunctionFactory;
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.Condition;
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.ConditionBuilder;
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.TopNCondition;
@@ -43,6 +45,7 @@ import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.
 import java.io.IOException;
 import java.sql.SQLException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -163,7 +166,7 @@ public class HBaseTimelineMetricStore extends AbstractService implements Timelin
   public TimelineMetrics getTimelineMetrics(List<String> metricNames,
       List<String> hostnames, String applicationId, String instanceId,
       Long startTime, Long endTime, Precision precision, Integer limit,
-      boolean groupedByHosts, TopNConfig topNConfig) throws SQLException, IOException {
+      boolean groupedByHosts, TopNConfig topNConfig, String seriesAggregateFunction) throws SQLException, IOException {
 
     if (metricNames == null || metricNames.isEmpty()) {
       throw new IllegalArgumentException("No metric name filter specified.");
@@ -175,6 +178,13 @@ public class HBaseTimelineMetricStore extends AbstractService implements Timelin
     if (limit != null && limit > PhoenixHBaseAccessor.RESULTSET_LIMIT){
       throw new IllegalArgumentException("Limit too big");
     }
+
+    TimelineMetricsSeriesAggregateFunction seriesAggrFunctionInstance = null;
+    if (!StringUtils.isEmpty(seriesAggregateFunction)) {
+      SeriesAggregateFunction func = SeriesAggregateFunction.getFunction(seriesAggregateFunction);
+      seriesAggrFunctionInstance = TimelineMetricsSeriesAggregateFunctionFactory.newInstance(func);
+    }
+
     Map<String, List<Function>> metricFunctions =
       parseMetricNamesToAggregationFunctions(metricNames);
 
@@ -214,7 +224,14 @@ public class HBaseTimelineMetricStore extends AbstractService implements Timelin
     } else {
       metrics = hBaseAccessor.getMetricRecords(condition, metricFunctions);
     }
-    return postProcessMetrics(metrics);
+
+    metrics = postProcessMetrics(metrics);
+
+    if (metrics.getMetrics().size() == 0) {
+      return metrics;
+    }
+
+    return seriesAggregateMetrics(seriesAggrFunctionInstance, metrics);
   }
 
   private TimelineMetrics postProcessMetrics(TimelineMetrics metrics) {
@@ -232,6 +249,15 @@ public class HBaseTimelineMetricStore extends AbstractService implements Timelin
     return metrics;
   }
 
+  private TimelineMetrics seriesAggregateMetrics(TimelineMetricsSeriesAggregateFunction seriesAggrFuncInstance,
+      TimelineMetrics metrics) {
+    if (seriesAggrFuncInstance != null) {
+      TimelineMetric appliedMetric = seriesAggrFuncInstance.apply(metrics);
+      metrics.setMetrics(Collections.singletonList(appliedMetric));
+    }
+    return metrics;
+  }
+
   static Map<Long, Double> updateValuesAsRate(Map<Long, Double> metricValues, boolean isDiff) {
     Long prevTime = null;
     Double prevVal = null;

http://git-wip-us.apache.org/repos/asf/ambari/blob/1c29d347/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStore.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStore.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStore.java
index 3e70330..3a8dc55 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStore.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStore.java
@@ -44,6 +44,8 @@ public interface TimelineMetricStore {
    * @param limit Override default result limit
    * @param groupedByHosts Group {@link TimelineMetric} by metric name, hostname,
    *                app id and instance id
+   * @param seriesAggregateFunction Specify this when caller want to aggregate multiple metrics
+   *                                series into one. [ SUM, AVG, MIN, MAX ]
    *
    * @return {@link TimelineMetric}
    * @throws java.sql.SQLException
@@ -51,7 +53,7 @@ public interface TimelineMetricStore {
   TimelineMetrics getTimelineMetrics(List<String> metricNames, List<String> hostnames,
                                      String applicationId, String instanceId, Long startTime,
                                      Long endTime, Precision precision, Integer limit, boolean groupedByHosts,
-                                     TopNConfig topNConfig)
+                                     TopNConfig topNConfig, String seriesAggregateFunction)
     throws SQLException, IOException;
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/1c29d347/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStoreWatcher.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStoreWatcher.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStoreWatcher.java
index 7d49070..aa53430 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStoreWatcher.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStoreWatcher.java
@@ -105,7 +105,7 @@ public class TimelineMetricStoreWatcher implements Runnable {
         TimelineMetrics timelineMetrics = timelineMetricStore.getTimelineMetrics(
           Collections.singletonList(FAKE_METRIC_NAME), Collections.singletonList(FAKE_HOSTNAME),
           FAKE_APP_ID, null, startTime - delay * 2 * 1000,
-          startTime + delay * 2 * 1000, Precision.SECONDS, 1, true, null);
+          startTime + delay * 2 * 1000, Precision.SECONDS, 1, true, null, null);
         return timelineMetrics.getMetrics().get(0);
       }
     };

http://git-wip-us.apache.org/repos/asf/ambari/blob/1c29d347/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TimelineWebServices.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TimelineWebServices.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TimelineWebServices.java
index 2616c99..df9aa1f 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TimelineWebServices.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TimelineWebServices.java
@@ -343,7 +343,8 @@ public class TimelineWebServices {
     @QueryParam("grouped") String grouped,
     @QueryParam("topN") String topN,
     @QueryParam("topNFunction") String topNFunction,
-    @QueryParam("isBottomN") String isBottomN
+    @QueryParam("isBottomN") String isBottomN,
+    @QueryParam("seriesAggregateFunction") String seriesAggregateFunction
   ) {
     init(res);
     try {
@@ -352,14 +353,15 @@ public class TimelineWebServices {
           "appId: " + appId + ", instanceId: " + instanceId + ", " +
           "hostname: " + hostname + ", startTime: " + startTime + ", " +
           "endTime: " + endTime + ", " +
-          "precision: " + precision);
+          "precision: " + precision + "seriesAggregateFunction: " + seriesAggregateFunction);
       }
 
       return timelineMetricStore.getTimelineMetrics(
         parseListStr(metricNames, ","), parseListStr(hostname, ","), appId, instanceId,
         parseLongStr(startTime), parseLongStr(endTime),
         Precision.getPrecision(precision), parseIntStr(limit),
-        parseBoolean(grouped), parseTopNConfig(topN, topNFunction, isBottomN));
+        parseBoolean(grouped), parseTopNConfig(topN, topNFunction, isBottomN),
+        seriesAggregateFunction);
 
     } catch (NumberFormatException ne) {
       throw new BadRequestException("startTime and limit should be numeric " +

http://git-wip-us.apache.org/repos/asf/ambari/blob/1c29d347/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestTimelineMetricStore.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestTimelineMetricStore.java b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestTimelineMetricStore.java
index 7551bf5..f30be22 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestTimelineMetricStore.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestTimelineMetricStore.java
@@ -38,7 +38,8 @@ public class TestTimelineMetricStore implements TimelineMetricStore {
   @Override
   public TimelineMetrics getTimelineMetrics(List<String> metricNames,
       List<String> hostnames, String applicationId, String instanceId, Long startTime,
-      Long endTime, Precision precision, Integer limit, boolean groupedByHost, TopNConfig topNConfig) throws SQLException,
+      Long endTime, Precision precision, Integer limit, boolean groupedByHost,
+      TopNConfig topNConfig, String seriesAggregateFunction) throws SQLException,
     IOException {
     TimelineMetrics timelineMetrics = new TimelineMetrics();
     List<TimelineMetric> metricList = new ArrayList<TimelineMetric>();

http://git-wip-us.apache.org/repos/asf/ambari/blob/1c29d347/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStoreWatcherTest.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStoreWatcherTest.java b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStoreWatcherTest.java
index a94f4c5..54b8442 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStoreWatcherTest.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricStoreWatcherTest.java
@@ -32,6 +32,7 @@ import org.powermock.modules.junit4.PowerMockRunner;
 import java.util.List;
 
 import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.anyString;
 import static org.easymock.EasyMock.createNiceMock;
 import static org.easymock.EasyMock.eq;
 import static org.easymock.EasyMock.expect;
@@ -57,7 +58,7 @@ public class TimelineMetricStoreWatcherTest {
     expect(metricStore.getTimelineMetrics(EasyMock.<List<String>>anyObject(),
       EasyMock.<List<String>>anyObject(), anyObject(String.class),
       anyObject(String.class), anyObject(Long.class), anyObject(Long.class),
-      eq(Precision.SECONDS), eq(1), eq(true), anyObject(TopNConfig.class)))
+      eq(Precision.SECONDS), eq(1), eq(true), anyObject(TopNConfig.class), anyString()))
       .andReturn(null).anyTimes();
 
     mockStatic(ExitUtil.class);
@@ -84,7 +85,7 @@ public class TimelineMetricStoreWatcherTest {
     expect(metricStore.getTimelineMetrics(EasyMock.<List<String>>anyObject(),
       EasyMock.<List<String>>anyObject(), anyObject(String.class),
       anyObject(String.class), anyObject(Long.class), anyObject(Long.class),
-      eq(Precision.SECONDS), eq(1), eq(true), anyObject(TopNConfig.class)))
+      eq(Precision.SECONDS), eq(1), eq(true), anyObject(TopNConfig.class), anyString()))
       .andReturn(null).anyTimes();
 
     String msg = "Error getting metrics from TimelineMetricStore. " +