AMBARI-19452 : Metrics of flume shows same values for all channels,sinks or sources in host. (wangjianfei via avijayan)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3a951927 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3a951927 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3a951927 Branch: refs/heads/branch-feature-AMBARI-12556 Commit: 3a9519279e3f3b9ba113fb1bc1d3241e6bd9f2a8 Parents: 5d695d8 Author: Aravindan Vijayan <[email protected]> Authored: Sun Feb 12 14:23:54 2017 -0800 Committer: Aravindan Vijayan <[email protected]> Committed: Sun Feb 12 14:23:54 2017 -0800 ---------------------------------------------------------------------- .../controller/metrics/timeline/AMSPropertyProvider.java | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/3a951927/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java index f194f8e..759f595 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java @@ -441,6 +441,14 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider { } else { propertyId = substituteArgument(propertyId, "$1", metric.getInstanceId()); } + }else { + if(metric.getInstanceId() != null){ + //instanceId "CHANNEL.ch1" + String instanceId = metric.getInstanceId(); + instanceId = instanceId.matches("^\\w+\\..+$") ? instanceId.split("\\.")[1]:""; + //propertyId "metrics/flume/flume/CHANNEL/ch1/[ChannelCapacity]" + if(!propertyId.contains(instanceId)) continue; + } } Object value = getValue(metric, temporalInfo); if (value != null && !containsArguments(propertyId)) {
