synchronized void add(String name, MutableMetric metric) { addNewMetricIfAbsent(name, metric, MutableMetric.class); }
/** * 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); }
/** * 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); }
/** * Create a mutable metric with stats * @param name of the metric * @param desc metric description * @param sampleName of the metric (e.g., "Ops") * @param valueName of the metric (e.g., "Time" or "Latency") * @param extended produce extended stat (stdev, min/max etc.) if true. * @return a new mutable stat metric object */ public MutableStat newStat(String name, String desc, String sampleName, String valueName, boolean extended) { MutableStat ret = new MutableStat(name, desc, sampleName, valueName, extended); return addNewMetricIfAbsent(name, ret, MutableStat.class); }
/** * Create a mutable long integer gauge * @param info metadata of the metric * @param iVal initial value * @return a new gauge object */ public MutableGaugeLong newGauge(MetricsInfo info, long iVal) { MutableGaugeLong ret = new MutableGaugeLong(info, iVal); return addNewMetricIfAbsent(info.name(), ret, MutableGaugeLong.class); }
/** * Create a mutable long integer counter * @param info metadata of the metric * @param iVal initial value * @return a new counter object */ public MutableFastCounter newCounter(MetricsInfo info, long iVal) { MutableFastCounter ret = new MutableFastCounter(info, iVal); return addNewMetricIfAbsent(info.name(), ret, MutableFastCounter.class); }
@InterfaceAudience.Private public MutableRate newRate(String name, String desc, boolean extended, boolean returnExisting) { if (returnExisting) { MutableMetric rate = metricsMap.get(name); if (rate != null) { if (rate instanceof MutableRate) { return (MutableRate) rate; } throw new MetricsException("Unexpected metrics type "+ rate.getClass() +" for "+ name); } } MutableRate ret = new MutableRate(name, desc, extended); return addNewMetricIfAbsent(name, ret, MutableRate.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); }
/** * 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); }
/** * 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); }
public MetricMutableQuantiles newQuantile(String name, String desc) { MetricMutableQuantiles histo = new MetricMutableQuantiles(name, desc, "Ops", "", 60); return addNewMetricIfAbsent(name, histo, MetricMutableQuantiles.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); }
/** * 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. * @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 mutable long integer gauge * @param info metadata of the metric * @param iVal initial value * @return a new gauge object */ public MutableGaugeLong newGauge(MetricsInfo info, long iVal) { MutableGaugeLong ret = new MutableGaugeLong(info, iVal); return addNewMetricIfAbsent(info.name(), ret, MutableGaugeLong.class); }
/** * Create a mutable integer counter * @param info metadata of the metric * @param iVal initial value * @return a new counter object */ public MutableCounterInt newCounter(MetricsInfo info, int iVal) { MutableCounterInt ret = new MutableCounterInt(info, iVal); return addNewMetricIfAbsent(info.name(), ret, MutableCounterInt.class); }
/** * Create a mutable long integer counter * @param info metadata of the metric * @param iVal initial value * @return a new counter object */ public MutableCounterLong newCounter(MetricsInfo info, long iVal) { MutableCounterLong ret = new MutableCounterLong(info, iVal); return addNewMetricIfAbsent(info.name(), ret, MutableCounterLong.class); }
/** * Create a mutable long integer gauge * @param info metadata of the metric * @param iVal initial value * @return a new gauge object */ public MutableGaugeLong newGauge(MetricsInfo info, long iVal) { MutableGaugeLong ret = new MutableGaugeLong(info, iVal); return addNewMetricIfAbsent(info.name(), ret, MutableGaugeLong.class); }
/** * Create a mutable long integer counter * @param info metadata of the metric * @param iVal initial value * @return a new counter object */ public MutableFastCounter newCounter(MetricsInfo info, long iVal) { MutableFastCounter ret = new MutableFastCounter(info, iVal); return addNewMetricIfAbsent(info.name(), ret, MutableFastCounter.class); }