cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [2/7] git commit: Correctly name FileCache metrics.
Date Fri, 23 May 2014 19:11:41 GMT
Correctly name FileCache metrics.

Patch by Nick Bailey, reviewed by brandonwilliams for CASSANDRA-7294


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

Branch: refs/heads/cassandra-2.0
Commit: 6d8be12a1538aea0932dddd448dcf7a0620d638d
Parents: 926f639
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Fri May 23 14:08:29 2014 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Fri May 23 14:08:29 2014 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/metrics/FileCacheMetrics.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6d8be12a/src/java/org/apache/cassandra/metrics/FileCacheMetrics.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/metrics/FileCacheMetrics.java b/src/java/org/apache/cassandra/metrics/FileCacheMetrics.java
index 9b21de6..42444f3 100644
--- a/src/java/org/apache/cassandra/metrics/FileCacheMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/FileCacheMetrics.java
@@ -28,6 +28,8 @@ import org.apache.cassandra.service.FileCacheService;
 
 public class FileCacheMetrics
 {
+    private static final MetricNameFactory factory = new DefaultNameFactory("FileCache");
+
     /** Total number of hits */
     public final Meter hits;
     /** Total number of requests */
@@ -39,9 +41,9 @@ public class FileCacheMetrics
 
     public FileCacheMetrics()
     {
-        hits = Metrics.newMeter(new MetricName(FileCacheService.class, "Hits"), "hits", TimeUnit.SECONDS);
-        requests = Metrics.newMeter(new MetricName(FileCacheService.class, "Requests"), "requests",
TimeUnit.SECONDS);
-        hitRate = Metrics.newGauge(new MetricName(FileCacheService.class, "HitRate"), new
RatioGauge()
+        hits = Metrics.newMeter(factory.createMetricName("Hits"), "hits", TimeUnit.SECONDS);
+        requests = Metrics.newMeter(factory.createMetricName("Requests"), "requests", TimeUnit.SECONDS);
+        hitRate = Metrics.newGauge(factory.createMetricName("HitRate"), new RatioGauge()
         {
             protected double getNumerator()
             {
@@ -53,7 +55,7 @@ public class FileCacheMetrics
                 return requests.count();
             }
         });
-        size = Metrics.newGauge(new MetricName(FileCacheService.class, "Size"), new Gauge<Long>()
+        size = Metrics.newGauge(factory.createMetricName("Size"), new Gauge<Long>()
         {
             public Long value()
             {


Mime
View raw message