/** * Create a mutable long integer counter * @param name of the metric * @param desc metric description * @param iVal initial value * @return a new counter object */ public MutableFastCounter newCounter(String name, String desc, long iVal) { return newCounter(new MetricsInfoImpl(name, desc), iVal); }
/** * Increment a named counter by some value. * * @param key the name of the counter * @param delta the ammount to increment */ public void incCounters(String key, long delta) { MutableFastCounter counter = metricsRegistry.getCounter(key, 0L); counter.incr(delta); }
public void resetWmMetrics() { wmTotalGuaranteedCount.set(0); wmUnusedGuaranteedCount.set(0); wmGuaranteedCount.incr(-wmGuaranteedCount.value()); wmSpeculativeCount.incr(-wmSpeculativeCount.value()); wmGuaranteedPendingCount.incr(-wmGuaranteedPendingCount.value()); wmSpeculativePendingCount.incr(-wmSpeculativePendingCount.value()); }
/** * Create a mutable long integer gauge * @param name of the metric * @param desc metric description * @param iVal initial value * @return a new gauge object */ public MutableGaugeLong newGauge(String name, String desc, long iVal) { return newGauge(new MetricsInfoImpl(name, desc), iVal); }
/** * Add a tag to the metrics * @param name of the tag * @param description of the tag * @param value of the tag * @param override existing tag if true * @return the registry (for keep adding tags) */ public DynamicMetricsRegistry tag(String name, String description, String value, boolean override) { return tag(new MetricsInfoImpl(name, description), value, override); }
/** * Create a new histogram with size range counts. * @param name The name of the histogram * @param desc The description of the data in the histogram. * @return A new MutableSizeHistogram */ public MutableSizeHistogram newSizeHistogram(String name, String desc) { MutableSizeHistogram histo = new MutableSizeHistogram(name, desc); return addNewMetricIfAbsent(name, histo, MutableSizeHistogram.class); }
@Override public void updateHistogram(String name, long value) { MutableHistogram histo = metricsRegistry.getHistogram(name); histo.add(value); }
/** * Create a new histogram. * @param name The name of the histogram * @param desc The description of the data in the histogram. * @return A new MutableHistogram */ public MutableHistogram newHistogram(String name, String desc) { MutableHistogram histo = new MutableHistogram(name, desc); return addNewMetricIfAbsent(name, histo, MutableHistogram.class); }
/** * Create a new histogram with time range counts. * @param name The name of the histogram * @param desc The description of the data in the histogram. * @return A new MutableTimeHistogram */ public MutableTimeHistogram newTimeHistogram(String name, String desc) { MutableTimeHistogram histo = new MutableTimeHistogram(name, desc); return addNewMetricIfAbsent(name, histo, MutableTimeHistogram.class); }