accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [2/2] accumulo git commit: Switch entries and entriesInMem from stat to a gauge.
Date Thu, 04 Dec 2014 18:24:52 GMT
Switch entries and entriesInMem from stat to a gauge.


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

Branch: refs/heads/metrics2-backwardscompat
Commit: e199f1b1dcfc75757fbf1f9682d2fb3b075d0325
Parents: f01370d
Author: Josh Elser <elserj@apache.org>
Authored: Thu Dec 4 13:24:25 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Dec 4 13:24:25 2014 -0500

----------------------------------------------------------------------
 .../tserver/metrics/Metrics2TabletServerMetrics.java   | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/e199f1b1/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 70f2a2e..8d47ba7 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
@@ -40,18 +40,19 @@ public class Metrics2TabletServerMetrics implements Metrics, MetricsSource
{
   private final MetricsSystem system;
   private final MetricsRegistry registry;
 
-  private final MutableStat entries, entriesInMemory, filesPerTablet;
-  private final MutableGaugeLong activeMajcs, queuedMajcs, activeMincs, queuedMincs, onlineTablets,
openingTablets, unopenedTablets, queries, totalMincs;
+  private final MutableStat filesPerTablet;
+  private final MutableGaugeLong entries, entriesInMemory, activeMajcs, queuedMajcs, activeMincs,
queuedMincs, onlineTablets, openingTablets, unopenedTablets,
+      queries, totalMincs;
 
   Metrics2TabletServerMetrics(TabletServer tserver, MetricsSystem system) {
     this.tserver = tserver;
     this.system = system;
     this.registry = new MetricsRegistry(Interns.info("TabletServerMetrics", "General TabletServer
Metrics"));
 
-    entries = registry.newStat(ENTRIES, "Number of entries", "Ops", "Count");
-    entriesInMemory = registry.newStat(ENTRIES_IN_MEM, "Number of entries in memory", "Ops",
"Count");
     filesPerTablet = registry.newStat(FILES_PER_TABLET, "Number of files per tablet", "Ops",
"Files", true);
 
+    entries = registry.newGauge(Interns.info(ENTRIES, "Number of entries"), 0l);
+    entriesInMemory = registry.newGauge(Interns.info(ENTRIES_IN_MEM, "Number of entries in
memory"), 0l);
     activeMajcs = registry.newGauge(Interns.info(ACTIVE_MAJCS, "Number of active major compactions"),
0l);
     queuedMajcs = registry.newGauge(Interns.info(QUEUED_MAJCS, "Number of queued major compactions"),
0l);
     activeMincs = registry.newGauge(Interns.info(ACTIVE_MINCS, "Number of active minor compactions"),
0l);
@@ -79,10 +80,10 @@ public class Metrics2TabletServerMetrics implements Metrics, MetricsSource
{
   }
 
   protected void snapshot() {
-    entries.add(getEntries());
-    entriesInMemory.add(getEntriesInMemory());
     filesPerTablet.add((long) getAverageFilesPerTablet());
 
+    entries.set(getEntries());
+    entriesInMemory.set(getEntriesInMemory());
     activeMajcs.set(getMajorCompactions());
     queuedMajcs.set(getMajorCompactionsQueued());
     activeMincs.set(getMinorCompactions());


Mime
View raw message