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;
|
||||
|
||||
paramName = (paramName == null)? "" : "/" + paramName;
|
||||
latency = APIMetrics.newTimer(url + "/histogram" + paramName,
|
||||
latency = APIMetrics.newTimer(url + "/moving_average_histogram" + paramName,
|
||||
factory.createMetricName(namePrefix + "Latency"),
|
||||
TimeUnit.MICROSECONDS, TimeUnit.SECONDS);
|
||||
totalLatency = APIMetrics.newCounter(url + paramName,
|
||||
@ -135,12 +135,7 @@ public class LatencyMetrics {
|
||||
|
||||
/** takes nanoseconds **/
|
||||
public void addNano(long nanos) {
|
||||
// convert to microseconds. 1 millionth
|
||||
latency.update(nanos, TimeUnit.NANOSECONDS);
|
||||
totalLatency.inc(nanos / 1000);
|
||||
for (LatencyMetrics parent : parents) {
|
||||
parent.addNano(nanos);
|
||||
}
|
||||
// the object is only updated from the API
|
||||
}
|
||||
|
||||
public void release() {
|
||||
|
Loading…
Reference in New Issue
Block a user