accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwa...@apache.org
Subject [accumulo] branch 1.8 updated: Fixes #404 Enabled more metrics reporting (#403)
Date Thu, 22 Mar 2018 15:55:29 GMT
This is an automated email from the ASF dual-hosted git repository.

mwalch pushed a commit to branch 1.8
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/1.8 by this push:
     new bf53114  Fixes #404 Enabled more metrics reporting (#403)
bf53114 is described below

commit bf53114030ae8874c1ee8d1cff1cca6b95fe019c
Author: Mike Walch <mwalch@apache.org>
AuthorDate: Thu Mar 22 11:55:26 2018 -0400

    Fixes #404 Enabled more metrics reporting (#403)
    
    * Added more ingest/scan metrics reporting to Hadoop2 metrics
---
 .../templates/hadoop-metrics2-accumulo.properties  |  4 +--
 .../metrics/Metrics2TabletServerMetrics.java       |  6 +++-
 .../tserver/metrics/TabletServerMetricsKeys.java   |  6 +++-
 .../tserver/metrics/TabletServerMetricsUtil.java   | 32 ++++++++++++++++++++++
 4 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/assemble/conf/templates/hadoop-metrics2-accumulo.properties b/assemble/conf/templates/hadoop-metrics2-accumulo.properties
index 7e3c7c0..f3593b5 100644
--- a/assemble/conf/templates/hadoop-metrics2-accumulo.properties
+++ b/assemble/conf/templates/hadoop-metrics2-accumulo.properties
@@ -13,8 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Poll collectors every ten seconds
-*.period=10
+# Poll collectors every thirty seconds
+*.period=30
 
 #
 # MetricSink configuration
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 d63b90c..599b2c9 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
@@ -104,6 +104,10 @@ public class Metrics2TabletServerMetrics implements Metrics, MetricsSource,
Tabl
     // TODO Some day, MetricsRegistry will also support the MetricsGaugeDouble or allow us
to instantiate it directly
     builder.addGauge(Interns.info(FILES_PER_TABLET, "Number of files per tablet"), util.getAverageFilesPerTablet());
     builder.addGauge(Interns.info(HOLD_TIME, "Time commits held"), util.getHoldTime());
+    builder.addGauge(Interns.info(INGEST_RATE, "Ingest rate (entries/sec)"), util.getIngest());
+    builder.addGauge(Interns.info(INGEST_BYTE_RATE, "Ingest rate (bytes/sec)"), util.getIngestByteRate());
+    builder.addGauge(Interns.info(QUERY_RATE, "Query rate (entries/sec)"), util.getQueryRate());
+    builder.addGauge(Interns.info(QUERY_BYTE_RATE, "Query rate (bytes/sec)"), util.getQueryByteRate());
+    builder.addGauge(Interns.info(SCANNED_RATE, "Scanned rate"), util.getScannedRate());
   }
-
 }
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsKeys.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsKeys.java
index 1d8d1af..b755597 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsKeys.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsKeys.java
@@ -34,5 +34,9 @@ public interface TabletServerMetricsKeys {
   String UNOPENED_TABLETS = "unopenedTablets";
   String QUERIES = "queries";
   String TOTAL_MINCS = "totalMinCs";
-
+  String INGEST_RATE = "ingestRate";
+  String INGEST_BYTE_RATE = "ingestByteRate";
+  String QUERY_RATE = "queryRate";
+  String QUERY_BYTE_RATE = "queryByteRate";
+  String SCANNED_RATE = "scannedRate";
 }
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsUtil.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsUtil.java
index 339ebf2..e31653d 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsUtil.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsUtil.java
@@ -56,6 +56,38 @@ public class TabletServerMetricsUtil {
     return result;
   }
 
+  public double getIngestByteRate() {
+    double result = 0;
+    for (Tablet tablet : tserver.getOnlineTablets()) {
+      result += tablet.ingestByteRate();
+    }
+    return result;
+  }
+
+  public double getQueryRate() {
+    double result = 0;
+    for (Tablet tablet : tserver.getOnlineTablets()) {
+      result += tablet.queryRate();
+    }
+    return result;
+  }
+
+  public double getQueryByteRate() {
+    double result = 0;
+    for (Tablet tablet : tserver.getOnlineTablets()) {
+      result += tablet.queryByteRate();
+    }
+    return result;
+  }
+
+  public double getScannedRate() {
+    double result = 0;
+    for (Tablet tablet : tserver.getOnlineTablets()) {
+      result += tablet.scanRate();
+    }
+    return result;
+  }
+
   public int getMajorCompactions() {
     int result = 0;
     for (Tablet tablet : tserver.getOnlineTablets()) {

-- 
To stop receiving notification emails like this one, please contact
mwalch@apache.org.

Mime
View raw message