accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] mikewalch closed pull request #403: Fixes #404 Provide Grafana dashboard for metrics
Date Thu, 22 Mar 2018 15:55:28 GMT
mikewalch closed pull request #403: Fixes #404 Provide Grafana dashboard for metrics
URL: https://github.com/apache/accumulo/pull/403
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/assemble/conf/templates/hadoop-metrics2-accumulo.properties b/assemble/conf/templates/hadoop-metrics2-accumulo.properties
index 7e3c7c083d..f3593b5ea4 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 d63b90c61f..599b2c9c25 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 void getMetrics(MetricsCollector collector, boolean all) {
     // 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 1d8d1af8d3..b75559781f 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 @@
   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 339ebf2585..e31653deaf 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 double getIngest() {
     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()) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message