accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [3/4] accumulo git commit: Some more tweaking of record name and context
Date Fri, 05 Dec 2014 22:56:49 GMT
Some more tweaking of record name and context


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

Branch: refs/heads/metrics2-backwardscompat
Commit: 15b3aa78123ce7aebab5cd18b21be0d410a59310
Parents: ac361d2
Author: Josh Elser <elserj@apache.org>
Authored: Fri Dec 5 17:41:28 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Dec 5 17:41:28 2014 -0500

----------------------------------------------------------------------
 .../java/org/apache/accumulo/server/metrics/Metrics.java  |  5 +++--
 .../accumulo/server/metrics/Metrics2ThriftMetrics.java    | 10 +++++-----
 .../master/metrics/Metrics2ReplicationMetrics.java        |  5 +++--
 .../tserver/metrics/Metrics2TabletServerMetrics.java      |  4 ++--
 .../tserver/metrics/Metrics2TabletServerMinCMetrics.java  |  5 +++--
 .../tserver/metrics/Metrics2TabletServerScanMetrics.java  |  4 ++--
 .../metrics/Metrics2TabletServerUpdateMetrics.java        |  4 ++--
 7 files changed, 20 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/15b3aa78/server/base/src/main/java/org/apache/accumulo/server/metrics/Metrics.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/metrics/Metrics.java b/server/base/src/main/java/org/apache/accumulo/server/metrics/Metrics.java
index 77b30ca..f451266 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/metrics/Metrics.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/metrics/Metrics.java
@@ -22,8 +22,9 @@ package org.apache.accumulo.server.metrics;
 public interface Metrics {
 
   String PREFIX = "Accumulo";
-  String TSERVER_RECORD = "TabletServer";
-  String MASTER_RECORD = "Master";
+  String THRIFT_NAME = "Thrift";
+  String TSERVER_NAME = "TabletServer";
+  String MASTER_NAME = "Master";
 
   void register() throws Exception;
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/15b3aa78/server/base/src/main/java/org/apache/accumulo/server/metrics/Metrics2ThriftMetrics.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/metrics/Metrics2ThriftMetrics.java
b/server/base/src/main/java/org/apache/accumulo/server/metrics/Metrics2ThriftMetrics.java
index 300e1a3..d166899 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/metrics/Metrics2ThriftMetrics.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/metrics/Metrics2ThriftMetrics.java
@@ -27,16 +27,16 @@ import org.apache.hadoop.metrics2.lib.MetricsRegistry;
  *
  */
 public class Metrics2ThriftMetrics implements Metrics, MetricsSource, ThriftMetricsKeys {
-  public static final String RECORD_NAME = "Thrift";
+  public static final String CONTEXT = "thrift";
 
   private final MetricsSystem system;
   private final MetricsRegistry registry;
-  private final String context, name, desc;
+  private final String record, name, desc;
 
   Metrics2ThriftMetrics(MetricsSystem system, String serverName, String threadName) {
     this.system = system;
-    this.context = serverName;
-    this.name = RECORD_NAME + ",sub=" + serverName;
+    this.record = serverName;
+    this.name = THRIFT_NAME + ",sub=" + serverName;
     this.desc = "Thrift Server Metrics - " + serverName + " " + threadName;
     this.registry = new MetricsRegistry(Interns.info(name, desc));
   }
@@ -58,7 +58,7 @@ public class Metrics2ThriftMetrics implements Metrics, MetricsSource, ThriftMetr
 
   @Override
   public void getMetrics(MetricsCollector collector, boolean all) {
-    MetricsRecordBuilder builder = collector.addRecord(RECORD_NAME).setContext(context);
+    MetricsRecordBuilder builder = collector.addRecord(record).setContext(CONTEXT);
 
     registry.snapshot(builder, all);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/15b3aa78/server/master/src/main/java/org/apache/accumulo/master/metrics/Metrics2ReplicationMetrics.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/metrics/Metrics2ReplicationMetrics.java
b/server/master/src/main/java/org/apache/accumulo/master/metrics/Metrics2ReplicationMetrics.java
index c62d7ac..9e35c61 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/metrics/Metrics2ReplicationMetrics.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/metrics/Metrics2ReplicationMetrics.java
@@ -37,7 +37,8 @@ import org.apache.hadoop.metrics2.lib.MetricsRegistry;
  *
  */
 public class Metrics2ReplicationMetrics implements Metrics, MetricsSource {
-  public static final String NAME = MASTER_RECORD + ",sub=Replication", DESCRIPTION = "Data-Center
Replication Metrics";
+  public static final String NAME = MASTER_NAME + ",sub=Replication", DESCRIPTION = "Data-Center
Replication Metrics", CONTEXT = "master",
+      RECORD = "MasterReplication";
   public static final String PENDING_FILES = "filesPendingReplication", NUM_PEERS = "numPeers",
MAX_REPLICATION_THREADS = "maxReplicationThreads";
 
   private final Master master;
@@ -61,7 +62,7 @@ public class Metrics2ReplicationMetrics implements Metrics, MetricsSource
{
 
   @Override
   public void getMetrics(MetricsCollector collector, boolean all) {
-    MetricsRecordBuilder builder = collector.addRecord(MASTER_RECORD).setContext("replication");
+    MetricsRecordBuilder builder = collector.addRecord(RECORD).setContext(CONTEXT);
 
     snapshot();
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/15b3aa78/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerMetrics.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerMetrics.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerMetrics.java
index 8095a6b..b470a8f 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerMetrics.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerMetrics.java
@@ -30,7 +30,7 @@ import org.apache.hadoop.metrics2.lib.MutableGaugeLong;
  *
  */
 public class Metrics2TabletServerMetrics implements Metrics, MetricsSource, TabletServerMetricsKeys
{
-  public static final String NAME = TSERVER_RECORD + ",sub=General", DESCRIPTION = "General
TabletServer Metrics", CONTEXT = "general";
+  public static final String NAME = TSERVER_NAME + ",sub=General", DESCRIPTION = "General
TabletServer Metrics", CONTEXT = "tserver", RECORD = "general";
 
   private final TabletServerMetricsUtil util;
   private final MetricsSystem system;
@@ -90,7 +90,7 @@ public class Metrics2TabletServerMetrics implements Metrics, MetricsSource,
Tabl
 
   @Override
   public void getMetrics(MetricsCollector collector, boolean all) {
-    MetricsRecordBuilder builder = collector.addRecord(TSERVER_RECORD).setContext(CONTEXT);
+    MetricsRecordBuilder builder = collector.addRecord(RECORD).setContext(CONTEXT);
 
     // Update each MutableMetric with the new value
     snapshot();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/15b3aa78/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerMinCMetrics.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerMinCMetrics.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerMinCMetrics.java
index ff3ee57..cd06c8e 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerMinCMetrics.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerMinCMetrics.java
@@ -29,7 +29,8 @@ import org.apache.hadoop.metrics2.lib.MutableStat;
  *
  */
 public class Metrics2TabletServerMinCMetrics implements Metrics, MetricsSource, TabletServerMinCMetricsKeys
{
-  public static final String NAME = TSERVER_RECORD + ",sub=MinorCompactions", DESCRIPTION
= "TabletServer Minor Compaction Metrics", CONTEXT = "minc";
+  public static final String NAME = TSERVER_NAME + ",sub=MinorCompactions", DESCRIPTION =
"TabletServer Minor Compaction Metrics", CONTEXT = "tserver",
+      RECORD = "MinorCompactions";
 
   private final MetricsSystem system;
   private final MetricsRegistry registry;
@@ -65,7 +66,7 @@ public class Metrics2TabletServerMinCMetrics implements Metrics, MetricsSource,
 
   @Override
   public void getMetrics(MetricsCollector collector, boolean all) {
-    MetricsRecordBuilder builder = collector.addRecord(TSERVER_RECORD).setContext(CONTEXT);
+    MetricsRecordBuilder builder = collector.addRecord(RECORD).setContext(CONTEXT);
 
     registry.snapshot(builder, all);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/15b3aa78/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerScanMetrics.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerScanMetrics.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerScanMetrics.java
index fdc6925..0c72cb5 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerScanMetrics.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerScanMetrics.java
@@ -29,7 +29,7 @@ import org.apache.hadoop.metrics2.lib.MutableStat;
  *
  */
 public class Metrics2TabletServerScanMetrics implements Metrics, MetricsSource, TabletServerScanMetricsKeys
{
-  public static final String NAME = TSERVER_RECORD + ",sub=Scans", DESCRIPTION = "TabletServer
Scan Metrics", CONTEXT = "scan";
+  public static final String NAME = TSERVER_NAME + ",sub=Scans", DESCRIPTION = "TabletServer
Scan Metrics", CONTEXT = "tserver", RECORD = "Scans";
 
   private final MetricsSystem system;
   private final MetricsRegistry registry;
@@ -67,7 +67,7 @@ public class Metrics2TabletServerScanMetrics implements Metrics, MetricsSource,
 
   @Override
   public void getMetrics(MetricsCollector collector, boolean all) {
-    MetricsRecordBuilder builder = collector.addRecord(TSERVER_RECORD).setContext(CONTEXT);
+    MetricsRecordBuilder builder = collector.addRecord(RECORD).setContext(CONTEXT);
 
     registry.snapshot(builder, all);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/15b3aa78/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerUpdateMetrics.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerUpdateMetrics.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerUpdateMetrics.java
index d422c4a..e1c91c6 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerUpdateMetrics.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/Metrics2TabletServerUpdateMetrics.java
@@ -30,7 +30,7 @@ import org.apache.hadoop.metrics2.lib.MutableStat;
  *
  */
 public class Metrics2TabletServerUpdateMetrics implements Metrics, MetricsSource, TabletServerUpdateMetricsKeys
{
-  public static final String NAME = TSERVER_RECORD + ",sub=Updates", DESCRIPTION = "TabletServer
Update Metrics", CONTEXT = "update";
+  public static final String NAME = TSERVER_NAME + ",sub=Updates", DESCRIPTION = "TabletServer
Update Metrics", CONTEXT = "tserver", RECORD = "Updates";
 
   private final MetricsSystem system;
   private final MetricsRegistry registry;
@@ -86,7 +86,7 @@ public class Metrics2TabletServerUpdateMetrics implements Metrics, MetricsSource
 
   @Override
   public void getMetrics(MetricsCollector collector, boolean all) {
-    MetricsRecordBuilder builder = collector.addRecord(TSERVER_RECORD).setContext(CONTEXT);
+    MetricsRecordBuilder builder = collector.addRecord(RECORD).setContext(CONTEXT);
 
     registry.snapshot(builder, all);
   }


Mime
View raw message