From 631a6537d97736969a5b4ec80d48b61231813197 Mon Sep 17 00:00:00 2001 From: Amnon Heiman Date: Sun, 9 Aug 2015 14:45:24 +0300 Subject: [PATCH] Add depricated implemention to the StorageProxy Some of the depricated function in StorgeProxy uses the Metrics object to get the information. This adds an implementation for the following: getReadOperations getTotalReadLatencyMicros getRecentReadLatencyMicros getTotalReadLatencyHistogramMicros getRangeOperations getTotalRangeLatencyMicros getRecentRangeLatencyMicros getWriteOperations getTotalWriteLatencyMicros getRecentWriteLatencyMicros It uses the implementation in ClientRequestMetrics without adding new functionality. Signed-off-by: Amnon Heiman --- .../apache/cassandra/service/StorageProxy.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/apache/cassandra/service/StorageProxy.java b/src/main/java/org/apache/cassandra/service/StorageProxy.java index c01a79d..70ca247 100644 --- a/src/main/java/org/apache/cassandra/service/StorageProxy.java +++ b/src/main/java/org/apache/cassandra/service/StorageProxy.java @@ -86,7 +86,7 @@ public class StorageProxy implements StorageProxyMBean { @Deprecated public long getReadOperations() { log(" getReadOperations()"); - return c.getLongValue(""); + return readMetrics.latency.count(); } /** @@ -95,7 +95,7 @@ public class StorageProxy implements StorageProxyMBean { @Deprecated public long getTotalReadLatencyMicros() { log(" getTotalReadLatencyMicros()"); - return c.getLongValue(""); + return readMetrics.totalLatency.count(); } /** @@ -104,7 +104,7 @@ public class StorageProxy implements StorageProxyMBean { @Deprecated public double getRecentReadLatencyMicros() { log(" getRecentReadLatencyMicros()"); - return c.getDoubleValue(""); + return readMetrics.getRecentLatency(); } /** @@ -128,19 +128,19 @@ public class StorageProxy implements StorageProxyMBean { @Deprecated public long getRangeOperations() { log(" getRangeOperations()"); - return c.getLongValue(""); + return rangeMetrics.latency.count(); } @Deprecated public long getTotalRangeLatencyMicros() { log(" getTotalRangeLatencyMicros()"); - return c.getLongValue(""); + return rangeMetrics.totalLatency.count(); } @Deprecated public double getRecentRangeLatencyMicros() { log(" getRecentRangeLatencyMicros()"); - return c.getDoubleValue(""); + return rangeMetrics.getRecentLatency(); } @Deprecated @@ -158,19 +158,19 @@ public class StorageProxy implements StorageProxyMBean { @Deprecated public long getWriteOperations() { log(" getWriteOperations()"); - return c.getLongValue(""); + return writeMetrics.latency.count(); } @Deprecated public long getTotalWriteLatencyMicros() { log(" getTotalWriteLatencyMicros()"); - return c.getLongValue(""); + return writeMetrics.totalLatency.count(); } @Deprecated public double getRecentWriteLatencyMicros() { log(" getRecentWriteLatencyMicros()"); - return c.getDoubleValue(""); + return writeMetrics.getRecentLatency(); } @Deprecated