cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r1064343 - in /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator: DynamicEndpointSnitch.java DynamicEndpointSnitchMBean.java
Date Thu, 27 Jan 2011 22:46:16 GMT
Author: brandonwilliams
Date: Thu Jan 27 22:46:15 2011
New Revision: 1064343

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

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

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java?rev=1064343&r1=1064342&r2=1064343&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
Thu Jan 27 22:46:15 2011
@@ -20,6 +20,7 @@ package org.apache.cassandra.locator;
 
 import java.lang.management.ManagementFactory;
 import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.LinkedBlockingDeque;
@@ -252,6 +253,20 @@ public class DynamicEndpointSnitch exten
         return subsnitch.getClass().getName();
     }
 
+    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;
+    }
 
 }
 
@@ -307,4 +322,5 @@ class AdaptiveLatencyTracker extends Abs
         }
         return log;
     }
+
 }

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/DynamicEndpointSnitchMBean.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/DynamicEndpointSnitchMBean.java?rev=1064343&r1=1064342&r2=1064343&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/DynamicEndpointSnitchMBean.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/locator/DynamicEndpointSnitchMBean.java
Thu Jan 27 22:46:15 2011
@@ -20,7 +20,9 @@
 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();
@@ -28,4 +30,5 @@ public interface DynamicEndpointSnitchMB
     public int getResetInterval();
     public double getBadnessThreshold();
     public String getSubsnitchClassName();
+    public List<Double> dumpTimings(String hostname) throws UnknownHostException;
 }



Mime
View raw message