LatencyMetrics: Move to APITimer
The APITimer uses a different endpoint not to break existing API. The addNano functionality was removed as all of the values are updated from the APi. Signed-off-by: Amnon Heiman <amnon@scylladb.com>
This commit is contained in:
parent
801af00ddb
commit
2c07ca2e09
@ -108,7 +108,7 @@ public class LatencyMetrics {
|
|||||||
this.namePrefix = namePrefix;
|
this.namePrefix = namePrefix;
|
||||||
|
|
||||||
paramName = (paramName == null)? "" : "/" + paramName;
|
paramName = (paramName == null)? "" : "/" + paramName;
|
||||||
latency = APIMetrics.newTimer(url + "/histogram" + paramName,
|
latency = APIMetrics.newTimer(url + "/moving_average_histogram" + paramName,
|
||||||
factory.createMetricName(namePrefix + "Latency"),
|
factory.createMetricName(namePrefix + "Latency"),
|
||||||
TimeUnit.MICROSECONDS, TimeUnit.SECONDS);
|
TimeUnit.MICROSECONDS, TimeUnit.SECONDS);
|
||||||
totalLatency = APIMetrics.newCounter(url + paramName,
|
totalLatency = APIMetrics.newCounter(url + paramName,
|
||||||
@ -135,12 +135,7 @@ public class LatencyMetrics {
|
|||||||
|
|
||||||
/** takes nanoseconds **/
|
/** takes nanoseconds **/
|
||||||
public void addNano(long nanos) {
|
public void addNano(long nanos) {
|
||||||
// convert to microseconds. 1 millionth
|
// the object is only updated from the API
|
||||||
latency.update(nanos, TimeUnit.NANOSECONDS);
|
|
||||||
totalLatency.inc(nanos / 1000);
|
|
||||||
for (LatencyMetrics parent : parents) {
|
|
||||||
parent.addNano(nanos);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void release() {
|
public void release() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user