/** * 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); }
public MutableHistogram getHistogram(String histoName) { //See getGauge for description on how this works. MutableMetric histo = metricsMap.get(histoName); if (histo == null) { MutableHistogram newCounter = new MutableHistogram(new MetricsInfoImpl(histoName, "")); histo = metricsMap.putIfAbsent(histoName, newCounter); if (histo == null) { return newCounter; } } if (!(histo instanceof MutableHistogram)) { throw new MetricsException("Metric already exists in registry for metric name: " + histoName + " and not of type MutableHistogram"); } return (MutableHistogram) histo; }
/** * 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 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); }
public MutableHistogram getHistogram(String histoName) { //See getLongGauge for description on how this works. MutableMetric histo = metricsMap.get(histoName); if (histo == null) { MutableHistogram newCounter = new MutableHistogram(new MetricsInfoImpl(histoName, "")); histo = metricsMap.putIfAbsent(histoName, newCounter); if (histo == null) { return newCounter; } } if (!(histo instanceof MutableHistogram)) { throw new MetricsException("Metric already exists in registry for metric name: " + histoName + " and not of type MutableHistogram"); } return (MutableHistogram) histo; }
public MutableHistogram getHistogram(String histoName) { //See getGauge for description on how this works. MutableMetric histo = metricsMap.get(histoName); if (histo == null) { MutableHistogram newCounter = new MutableHistogram(new MetricsInfoImpl(histoName, "")); histo = metricsMap.putIfAbsent(histoName, newCounter); if (histo == null) { return newCounter; } } if (!(histo instanceof MutableHistogram)) { throw new MetricsException("Metric already exists in registry for metric name: " + histoName + " and not of type MutableHistogram"); } return (MutableHistogram) histo; }
public MutableHistogram getHistogram(String histoName) { //See getGauge for description on how this works. MutableMetric histo = metricsMap.get(histoName); if (histo == null) { MutableHistogram newCounter = new MutableHistogram(new MetricsInfoImpl(histoName, "")); histo = metricsMap.putIfAbsent(histoName, newCounter); if (histo == null) { return newCounter; } } if (!(histo instanceof MutableHistogram)) { throw new MetricsException("Metric already exists in registry for metric name: " + histoName + " and not of type MutableHistogram"); } return (MutableHistogram) histo; }