From 6a89f1998893ed250de277a5c08a8828ce4f43fd Mon Sep 17 00:00:00 2001 From: Amnon Heiman Date: Tue, 14 Jul 2015 18:05:07 +0300 Subject: [PATCH] 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 --- .../org/apache/cassandra/metrics/ColumnFamilyMetrics.java | 6 +++--- .../java/org/apache/cassandra/metrics/CommitLogMetrics.java | 4 ++-- .../java/org/apache/cassandra/metrics/LatencyMetrics.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java b/src/main/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java index cb0fc7f..5f3cd91 100644 --- a/src/main/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java +++ b/src/main/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java @@ -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); diff --git a/src/main/java/org/apache/cassandra/metrics/CommitLogMetrics.java b/src/main/java/org/apache/cassandra/metrics/CommitLogMetrics.java index b1677fa..aacf2f8 100644 --- a/src/main/java/org/apache/cassandra/metrics/CommitLogMetrics.java +++ b/src/main/java/org/apache/cassandra/metrics/CommitLogMetrics.java @@ -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); } diff --git a/src/main/java/org/apache/cassandra/metrics/LatencyMetrics.java b/src/main/java/org/apache/cassandra/metrics/LatencyMetrics.java index 8a99d3e..9fc4c24 100644 --- a/src/main/java/org/apache/cassandra/metrics/LatencyMetrics.java +++ b/src/main/java/org/apache/cassandra/metrics/LatencyMetrics.java @@ -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,