cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [1/5] git commit: Revert "Fix LatencyMetrics returning infinity."
Date Thu, 03 Apr 2014 23:35:08 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 ab99b8e75 -> 4b09b8deb
  refs/heads/cassandra-2.1 d71b59e67 -> 6d901f90a


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/bc895172
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/bc895172
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/bc895172

Branch: refs/heads/cassandra-2.0
Commit: bc8951726e4830e6b9248b4417570f3363ff5eed
Parents: ab99b8e
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:29:58 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/bc895172/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