synchronized void add(String name, MutableMetric metric) { checkMetricName(name); metricsMap.put(name, metric); }
public synchronized MutableRollingAverages newMutableRollingAverages( String name, String valueName) { checkMetricName(name); MutableRollingAverages rollingAverages = new MutableRollingAverages(valueName); metricsMap.put(name, rollingAverages); return rollingAverages; }
public synchronized MutableRatesWithAggregation newRatesWithAggregation( String name) { checkMetricName(name); MutableRatesWithAggregation rates = new MutableRatesWithAggregation(); metricsMap.put(name, rates); return rates; }
/** * 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 synchronized MutableStat newStat(String name, String desc, String sampleName, String valueName, boolean extended) { checkMetricName(name); MutableStat ret = new MutableStat(name, desc, sampleName, valueName, extended); metricsMap.put(name, ret); return ret; }
@InterfaceAudience.Private public synchronized 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); } } checkMetricName(name); MutableRate ret = new MutableRate(name, desc, extended); metricsMap.put(name, ret); return ret; }
/** * Create a mutable integer gauge * @param info metadata of the metric * @param iVal initial value * @return a new gauge object */ public synchronized MutableGaugeInt newGauge(MetricsInfo info, int iVal) { checkMetricName(info.name()); MutableGaugeInt ret = new MutableGaugeInt(info, iVal); metricsMap.put(info.name(), ret); return ret; }
/** * Create a mutable long integer gauge * @param info metadata of the metric * @param iVal initial value * @return a new gauge object */ public synchronized MutableGaugeLong newGauge(MetricsInfo info, long iVal) { checkMetricName(info.name()); MutableGaugeLong ret = new MutableGaugeLong(info, iVal); metricsMap.put(info.name(), ret); return ret; }
/** * Create a mutable float gauge * @param info metadata of the metric * @param iVal initial value * @return a new gauge object */ public synchronized MutableGaugeFloat newGauge(MetricsInfo info, float iVal) { checkMetricName(info.name()); MutableGaugeFloat ret = new MutableGaugeFloat(info, iVal); metricsMap.put(info.name(), ret); return ret; }
/** * Create a mutable integer counter * @param info metadata of the metric * @param iVal initial value * @return a new counter object */ public synchronized MutableCounterInt newCounter(MetricsInfo info, int iVal) { checkMetricName(info.name()); MutableCounterInt ret = new MutableCounterInt(info, iVal); metricsMap.put(info.name(), ret); return ret; }
/** * Create a mutable long integer counter * @param info metadata of the metric * @param iVal initial value * @return a new counter object */ public synchronized MutableCounterLong newCounter(MetricsInfo info, long iVal) { checkMetricName(info.name()); MutableCounterLong ret = new MutableCounterLong(info, iVal); metricsMap.put(info.name(), ret); return ret; }
/** * Create a mutable metric that estimates quantiles of a stream of values * @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 interval rollover interval of estimator in seconds * @return a new quantile estimator object * @throws MetricsException if interval is not a positive integer */ public synchronized MutableQuantiles newQuantiles(String name, String desc, String sampleName, String valueName, int interval) { checkMetricName(name); if (interval <= 0) { throw new MetricsException("Interval should be positive. Value passed" + " is: " + interval); } MutableQuantiles ret = new MutableQuantiles(name, desc, sampleName, valueName, interval); metricsMap.put(name, ret); return ret; }
public synchronized MutableRatesWithAggregation newRatesWithAggregation( String name) { checkMetricName(name); MutableRatesWithAggregation rates = new MutableRatesWithAggregation(); metricsMap.put(name, rates); return rates; }
public synchronized MutableRatesWithAggregation newRatesWithAggregation( String name) { checkMetricName(name); MutableRatesWithAggregation rates = new MutableRatesWithAggregation(); metricsMap.put(name, rates); return rates; }
/** * Create a mutable integer gauge * @param info metadata of the metric * @param iVal initial value * @return a new gauge object */ public synchronized MutableGaugeInt newGauge(MetricsInfo info, int iVal) { checkMetricName(info.name()); MutableGaugeInt ret = new MutableGaugeInt(info, iVal); metricsMap.put(info.name(), ret); return ret; }
/** * Create a mutable long integer gauge * @param info metadata of the metric * @param iVal initial value * @return a new gauge object */ public synchronized MutableGaugeLong newGauge(MetricsInfo info, long iVal) { checkMetricName(info.name()); MutableGaugeLong ret = new MutableGaugeLong(info, iVal); metricsMap.put(info.name(), ret); return ret; }
/** * Create a mutable long integer gauge * @param info metadata of the metric * @param iVal initial value * @return a new gauge object */ public synchronized MutableGaugeLong newGauge(MetricsInfo info, long iVal) { checkMetricName(info.name()); MutableGaugeLong ret = new MutableGaugeLong(info, iVal); metricsMap.put(info.name(), ret); return ret; }
/** * Create a mutable long integer gauge * @param info metadata of the metric * @param iVal initial value * @return a new gauge object */ public synchronized MutableGaugeLong newGauge(MetricsInfo info, long iVal) { checkMetricName(info.name()); MutableGaugeLong ret = new MutableGaugeLong(info, iVal); metricsMap.put(info.name(), ret); return ret; }
/** * Create a mutable long integer gauge * @param info metadata of the metric * @param iVal initial value * @return a new gauge object */ public synchronized MutableGaugeLong newGauge(MetricsInfo info, long iVal) { checkMetricName(info.name()); MutableGaugeLong ret = new MutableGaugeLong(info, iVal); metricsMap.put(info.name(), ret); return ret; }
/** * Create a mutable integer gauge * @param info metadata of the metric * @param iVal initial value * @return a new gauge object */ public synchronized MutableGaugeInt newGauge(MetricsInfo info, int iVal) { checkMetricName(info.name()); MutableGaugeInt ret = new MutableGaugeInt(info, iVal); metricsMap.put(info.name(), ret); return ret; }
/** * Create a mutable integer counter * @param info metadata of the metric * @param iVal initial value * @return a new counter object */ public synchronized MutableCounterInt newCounter(MetricsInfo info, int iVal) { checkMetricName(info.name()); MutableCounterInt ret = new MutableCounterInt(info, iVal); metricsMap.put(info.name(), ret); return ret; }