/** * Removes the metric for the given class with the given name and scope. * * @param klass the klass the metric is associated with * @param name the name of the metric * @param scope the scope of the metric */ public void removeMetric(Class<?> klass, String name, String scope) { removeMetric(createName(klass, name, scope)); }
/** * Creates a new {@link Counter} and registers it under the given class and name. * * @param klass the class which owns the metric * @param name the name of the metric * @param scope the scope of the metric * @return a new {@link Counter} */ public Counter newCounter(Class<?> klass, String name, String scope) { return newCounter(createName(klass, name, scope)); }
/** * Creates a new {@link Histogram} and registers it under the given class, name, and scope. * * @param klass the class which owns the metric * @param name the name of the metric * @param scope the scope of the metric * @param biased whether or not the histogram should be biased * @return a new {@link Histogram} */ public Histogram newHistogram(Class<?> klass, String name, String scope, boolean biased) { return newHistogram(createName(klass, name, scope), biased); }
/** * Creates a new {@link Timer} and registers it under the given class, name, and scope. * * @param klass the class which owns the metric * @param name the name of the metric * @param scope the scope of the metric * @param durationUnit the duration scale unit of the new timer * @param rateUnit the rate scale unit of the new timer * @return a new {@link Timer} */ public Timer newTimer(Class<?> klass, String name, String scope, TimeUnit durationUnit, TimeUnit rateUnit) { return newTimer(createName(klass, name, scope), durationUnit, rateUnit); }
/** * Given a new {@link Gauge}, registers it under the given class and name. * * @param klass the class which owns the metric * @param name the name of the metric * @param scope the scope of the metric * @param metric the metric * @param <T> the type of the value returned by the metric * @return {@code metric} */ public <T> Gauge<T> newGauge(Class<?> klass, String name, String scope, Gauge<T> metric) { return newGauge(createName(klass, name, scope), metric); }
/** * Creates a new {@link Meter} and registers it under the given class, name, and scope. * * @param klass the class which owns the metric * @param name the name of the metric * @param scope the scope of the metric * @param eventType the plural name of the type of events the meter is measuring (e.g., {@code * "requests"}) * @param unit the rate unit of the new meter * @return a new {@link Meter} */ public Meter newMeter(Class<?> klass, String name, String scope, String eventType, TimeUnit unit) { return newMeter(createName(klass, name, scope), eventType, unit); }