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 <amnon@cloudius-systems.com>
This commit is contained in:
Amnon Heiman 2015-08-09 14:45:24 +03:00
parent db71bf6f89
commit 631a6537d9

View File

@ -86,7 +86,7 @@ public class StorageProxy implements StorageProxyMBean {
@Deprecated @Deprecated
public long getReadOperations() { public long getReadOperations() {
log(" getReadOperations()"); log(" getReadOperations()");
return c.getLongValue(""); return readMetrics.latency.count();
} }
/** /**
@ -95,7 +95,7 @@ public class StorageProxy implements StorageProxyMBean {
@Deprecated @Deprecated
public long getTotalReadLatencyMicros() { public long getTotalReadLatencyMicros() {
log(" getTotalReadLatencyMicros()"); log(" getTotalReadLatencyMicros()");
return c.getLongValue(""); return readMetrics.totalLatency.count();
} }
/** /**
@ -104,7 +104,7 @@ public class StorageProxy implements StorageProxyMBean {
@Deprecated @Deprecated
public double getRecentReadLatencyMicros() { public double getRecentReadLatencyMicros() {
log(" getRecentReadLatencyMicros()"); log(" getRecentReadLatencyMicros()");
return c.getDoubleValue(""); return readMetrics.getRecentLatency();
} }
/** /**
@ -128,19 +128,19 @@ public class StorageProxy implements StorageProxyMBean {
@Deprecated @Deprecated
public long getRangeOperations() { public long getRangeOperations() {
log(" getRangeOperations()"); log(" getRangeOperations()");
return c.getLongValue(""); return rangeMetrics.latency.count();
} }
@Deprecated @Deprecated
public long getTotalRangeLatencyMicros() { public long getTotalRangeLatencyMicros() {
log(" getTotalRangeLatencyMicros()"); log(" getTotalRangeLatencyMicros()");
return c.getLongValue(""); return rangeMetrics.totalLatency.count();
} }
@Deprecated @Deprecated
public double getRecentRangeLatencyMicros() { public double getRecentRangeLatencyMicros() {
log(" getRecentRangeLatencyMicros()"); log(" getRecentRangeLatencyMicros()");
return c.getDoubleValue(""); return rangeMetrics.getRecentLatency();
} }
@Deprecated @Deprecated
@ -158,19 +158,19 @@ public class StorageProxy implements StorageProxyMBean {
@Deprecated @Deprecated
public long getWriteOperations() { public long getWriteOperations() {
log(" getWriteOperations()"); log(" getWriteOperations()");
return c.getLongValue(""); return writeMetrics.latency.count();
} }
@Deprecated @Deprecated
public long getTotalWriteLatencyMicros() { public long getTotalWriteLatencyMicros() {
log(" getTotalWriteLatencyMicros()"); log(" getTotalWriteLatencyMicros()");
return c.getLongValue(""); return writeMetrics.totalLatency.count();
} }
@Deprecated @Deprecated
public double getRecentWriteLatencyMicros() { public double getRecentWriteLatencyMicros() {
log(" getRecentWriteLatencyMicros()"); log(" getRecentWriteLatencyMicros()");
return c.getDoubleValue(""); return writeMetrics.getRecentLatency();
} }
@Deprecated @Deprecated