cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r1064246 - in /cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/locator: DynamicEndpointSnitch.java DynamicEndpointSnitchMBean.java
Date Thu, 27 Jan 2011 18:33:13 GMT
Author: brandonwilliams
Date: Thu Jan 27 18:33:13 2011
New Revision: 1064246

URL: http://svn.apache.org/viewvc?rev=1064246&view=rev
Log:
Add ability to dump DES timings

Modified:
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/locator/DynamicEndpointSnitchMBean.java

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java?rev=1064246&r1=1064245&r2=1064246&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
Thu Jan 27 18:33:13 2011
@@ -174,6 +174,21 @@ public class DynamicEndpointSnitch exten
     {
         return scores;
     }
+
+    public List<Double> dumpTimings(String hostname) throws UnknownHostException
+    {
+        InetAddress host = InetAddress.getByName(hostname);
+        ArrayList<Double> timings = new ArrayList<Double>();
+        AdaptiveLatencyTracker window = windows.get(host);
+        if (window != null)
+        {
+            for (double time: window)
+            {
+                timings.add(time);
+            }
+        }
+        return timings;
+    }
 }
 
 /** a threadsafe version of BoundedStatsDeque+ArrivalWindow with modification for arbitrary
times **/

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/locator/DynamicEndpointSnitchMBean.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/locator/DynamicEndpointSnitchMBean.java?rev=1064246&r1=1064245&r2=1064246&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/locator/DynamicEndpointSnitchMBean.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/locator/DynamicEndpointSnitchMBean.java
Thu Jan 27 18:33:13 2011
@@ -20,8 +20,11 @@
 package org.apache.cassandra.locator;
 
 import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.Map;
+import java.util.List;
 
 public interface DynamicEndpointSnitchMBean {
     public Map<InetAddress, Double> getScores();
+    public List<Double> dumpTimings(String hostname) throws UnknownHostException;
 }



Mime
View raw message