cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [2/2] git commit: Revert "Fix LatencyMetrics returning infinity."
Date Thu, 03 Apr 2014 23:35:19 GMT
Revert "Fix LatencyMetrics returning infinity."

This reverts commit 5e51aa4e6d1d868bb82a1aa2ffaed4613b24ffc1.


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

Branch: refs/heads/trunk
Commit: 28d82160fc9e1082755ff770d189dacbabbeef80
Parents: 9baf92a
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Thu Apr 3 18:29:58 2014 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Thu Apr 3 18:31:39 2014 -0500

----------------------------------------------------------------------
 .../apache/cassandra/metrics/LatencyMetrics.java    | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/28d82160/src/java/org/apache/cassandra/metrics/LatencyMetrics.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/metrics/LatencyMetrics.java b/src/java/org/apache/cassandra/metrics/LatencyMetrics.java
index ef1dee9..b53449c 100644
--- a/src/java/org/apache/cassandra/metrics/LatencyMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/LatencyMetrics.java
@@ -85,11 +85,8 @@ public class LatencyMetrics
     public void addNano(long nanos)
     {
         // convert to microseconds. 1 millionth
-        synchronized (this)
-        {
-            latency.update(nanos, TimeUnit.NANOSECONDS);
-            totalLatency.inc(nanos / 1000);
-        }
+        latency.update(nanos, TimeUnit.NANOSECONDS);
+        totalLatency.inc(nanos / 1000);
         totalLatencyHistogram.add(nanos / 1000);
         recentLatencyHistogram.add(nanos / 1000);
     }
@@ -103,13 +100,8 @@ public class LatencyMetrics
     @Deprecated
     public double getRecentLatency()
     {
-        long ops = 0;
-        long n = 0;
-        synchronized (this)
-        {
-            ops = latency.count();
-            n = totalLatency.count();
-        }
+        long ops = latency.count();
+        long n = totalLatency.count();
         try
         {
             return ((double) n - lastLatency) / (ops - lastOpCount);


Mime
View raw message