Use APITimer in ColumnFamilyMetrics, CommitLogMetrics and LatencyMetrics

This changes the Timer in ColumnFamilyMetrics, CommitLogMetrics and
LatencyMetrics to be an APITimer.
The APITimer is passed the url to get the data from.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This commit is contained in:
Amnon Heiman 2015-07-14 18:05:07 +03:00
parent 62eec8aaf2
commit 6a89f19988
3 changed files with 6 additions and 6 deletions

View File

@ -325,13 +325,13 @@ public class ColumnFamilyMetrics {
colUpdateTimeDeltaHistogram = createColumnFamilyHistogram(
"/column_family/metrics/col_update_time_delta_histogram",
"ColUpdateTimeDeltaHistogram");
coordinatorReadLatency = Metrics.newTimer(
coordinatorReadLatency = APIMetrics.newTimer("/column_family/metrics/coordinator/read/" + cfName,
factory.createMetricName("CoordinatorReadLatency"),
TimeUnit.MICROSECONDS, TimeUnit.SECONDS);
coordinatorScanLatency = Metrics.newTimer(
coordinatorScanLatency = APIMetrics.newTimer("/column_family/metrics/coordinator/scan/" + cfName,
factory.createMetricName("CoordinatorScanLatency"),
TimeUnit.MICROSECONDS, TimeUnit.SECONDS);
waitingOnFreeMemtableSpace = Metrics.newTimer(
waitingOnFreeMemtableSpace = APIMetrics.newTimer("/column_family/metrics/waiting_on_free_memtable/" + cfName,
factory.createMetricName("WaitingOnFreeMemtableSpace"),
TimeUnit.MICROSECONDS, TimeUnit.SECONDS);

View File

@ -77,10 +77,10 @@ public class CommitLogMetrics {
return c.getLongValue("/commitlog/metrics/total_commit_log_size");
}
});
waitingOnSegmentAllocation = APIMetrics.newTimer(
waitingOnSegmentAllocation = APIMetrics.newTimer("/commit_log/metrics/waiting_on_segment_allocation",
factory.createMetricName("WaitingOnSegmentAllocation"),
TimeUnit.MICROSECONDS, TimeUnit.SECONDS);
waitingOnCommit = APIMetrics.newTimer(
waitingOnCommit = APIMetrics.newTimer("/commit_log/metrics/waiting_on_commit",
factory.createMetricName("WaitingOnCommit"),
TimeUnit.MICROSECONDS, TimeUnit.SECONDS);
}

View File

@ -95,7 +95,7 @@ public class LatencyMetrics {
this.factory = factory;
this.namePrefix = namePrefix;
latency = APIMetrics.newTimer(
latency = APIMetrics.newTimer(url + "/histogram",
factory.createMetricName(namePrefix + "Latency"),
TimeUnit.MICROSECONDS, TimeUnit.SECONDS);
totalLatency = APIMetrics.newCounter(url,