|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + * or more contributor license agreements. See the NOTICE file |
| 4 | + * distributed with this work for additional information |
| 5 | + * regarding copyright ownership. The ASF licenses this file |
| 6 | + * to you under the Apache License, Version 2.0 (the |
| 7 | + * "License"); you may not use this file except in compliance |
| 8 | + * with the License. You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, software |
| 13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + * See the License for the specific language governing permissions and |
| 16 | + * limitations under the License. |
| 17 | + */ |
| 18 | + |
| 19 | +package org.apache.cassandra.distributed.shared; |
| 20 | + |
| 21 | +import java.util.List; |
| 22 | +import java.util.Map; |
| 23 | +import java.util.function.Predicate; |
| 24 | + |
| 25 | +public interface Metrics |
| 26 | +{ |
| 27 | + List<String> getNames(); |
| 28 | + |
| 29 | + long getCounter(String name); |
| 30 | + Map<String, Long> getCounters(Predicate<String> filter); |
| 31 | + |
| 32 | + double getHistogram(String name, MetricValue value); |
| 33 | + Map<String, Double> getHistograms(Predicate<String> filter, MetricValue value); |
| 34 | + |
| 35 | + Object getGauge(String name); |
| 36 | + Map<String, Object> getGauges(Predicate<String> filter); |
| 37 | + |
| 38 | + double getMeter(String name, Rate value); |
| 39 | + Map<String, Double> getMeters(Predicate<String> filter, Rate value); |
| 40 | + |
| 41 | + double getTimer(String name, MetricValue value); |
| 42 | + Map<String, Double> getTimers(Predicate<String> filter, MetricValue value); |
| 43 | + |
| 44 | + enum MetricValue |
| 45 | + { |
| 46 | + COUNT, |
| 47 | + MEDIAN, P75, P95, P98, P99, P999, |
| 48 | + MAX, MEAN, MIN, STDDEV |
| 49 | + } |
| 50 | + |
| 51 | + enum Rate |
| 52 | + { |
| 53 | + RATE15_MIN, |
| 54 | + RATE5_MIN, |
| 55 | + RATE1_MIN, |
| 56 | + RATE_MEAN |
| 57 | + } |
| 58 | +} |
0 commit comments