add missing file
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/67db1bf2 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/67db1bf2 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/67db1bf2 Branch: refs/heads/trunk Commit: 67db1bf2786679b71dad8a32894346abdf59206e Parents: e938839 Author: Brandon Williams <brandonwilli...@apache.org> Authored: Thu Oct 16 12:16:16 2014 -0500 Committer: Brandon Williams <brandonwilli...@apache.org> Committed: Thu Oct 16 12:16:16 2014 -0500 ---------------------------------------------------------------------- .../metrics/CASClientRequestMetrics.java | 47 ++++++++++++++++++++ 1 file changed, 47 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/67db1bf2/src/java/org/apache/cassandra/metrics/CASClientRequestMetrics.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/metrics/CASClientRequestMetrics.java b/src/java/org/apache/cassandra/metrics/CASClientRequestMetrics.java new file mode 100644 index 0000000..3210d45 --- /dev/null +++ b/src/java/org/apache/cassandra/metrics/CASClientRequestMetrics.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cassandra.metrics; + +import com.yammer.metrics.*; +import com.yammer.metrics.core.*; + +public class CASClientRequestMetrics extends ClientRequestMetrics +{ + + public final Histogram contention; + /* Used only for write */ + public final Counter conditionNotMet; + + public final Counter unfinishedCommit; + + public CASClientRequestMetrics(String scope) { + super(scope); + contention = Metrics.newHistogram(factory.createMetricName("ContentionHistogram"), true); + conditionNotMet = Metrics.newCounter(factory.createMetricName("ConditionNotMet")); + unfinishedCommit = Metrics.newCounter(factory.createMetricName("UnfinishedCommit")); + } + + public void release() + { + super.release(); + Metrics.defaultRegistry().removeMetric(factory.createMetricName("ContentionHistogram")); + Metrics.defaultRegistry().removeMetric(factory.createMetricName("ConditionNotMet")); + Metrics.defaultRegistry().removeMetric(factory.createMetricName("UnfinishedCommit")); + } +}