accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/2] accumulo git commit: Fix the naming of each gauge to be unique.
Date Wed, 03 Dec 2014 18:29:08 GMT
Repository: accumulo
Updated Branches:
  refs/heads/metrics2 1208d8eaa -> ec8e49db2


Fix the naming of each gauge to be unique.


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

Branch: refs/heads/metrics2
Commit: b0fbb0c6f9d1c1d9d6e69fdd0e1209c13f186c8b
Parents: 1208d8e
Author: Josh Elser <elserj@apache.org>
Authored: Wed Dec 3 12:15:06 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Wed Dec 3 12:15:06 2014 -0500

----------------------------------------------------------------------
 .../accumulo/server/metrics/AbstractMetricsImpl.java  | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/b0fbb0c6/server/base/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
b/server/base/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
index 570feb7..42ca83c 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
@@ -36,6 +36,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
 import org.apache.commons.lang.builder.ToStringStyle;
 import org.apache.commons.lang.time.DateUtils;
 import org.apache.hadoop.metrics2.MetricsCollector;
+import org.apache.hadoop.metrics2.MetricsRecordBuilder;
 import org.apache.hadoop.metrics2.MetricsSource;
 
 public abstract class AbstractMetricsImpl implements MetricsSource {
@@ -45,9 +46,16 @@ public abstract class AbstractMetricsImpl implements MetricsSource {
     for (Entry<String,Metric> entry : registry.entrySet()) {
       String name = entry.getKey();
       Metric metric = entry.getValue();
-      collector.addRecord("Accumulo").setContext(getMetricsPrefix()).addGauge(info(name,
name + " count"), metric.getCount())
-          .addGauge(info(name, name + " min"), metric.getMin()).addGauge(info(name, name
+ " max"), metric.getMax())
-          .addGauge(info(name, name + " avg"), metric.getAvg());
+      MetricsRecordBuilder builder = collector.addRecord("Accumulo").setContext(getMetricsPrefix());
+
+      String count = name + " count";
+      builder.addGauge(info(count, count), metric.getCount());
+      String min = name + " min";
+      builder.addGauge(info(min, min), metric.getMin());
+      String max = name + " max";
+      builder.addGauge(info(max, max), metric.getMax());
+      String avg = name + " avg";
+      builder.addGauge(info(avg, avg), metric.getAvg());
     }
   }
 


Mime
View raw message