/** * Constructor - create a new metric * @param nam the name of the metrics to be used to publish the metric * @param registry - where the metrics object will be registered */ public MetricsTimeVaryingRate(final String nam, final MetricsRegistry registry, final String description) { super(nam, description); currentData = new Metrics(); previousIntervalData = new Metrics(); minMax = new MinMax(); registry.add(nam, this); }
private static MetricsRegistry copyMinusHBaseMetrics(final MetricsRegistry mr) { MetricsRegistry copy = new MetricsRegistry(); for (MetricsBase metric : mr.getMetricsList()) { if (metric instanceof MetricsRate || metric instanceof MetricsString || metric instanceof MetricsHistogram || metric instanceof ExactCounterMetric) { continue; } copy.add(metric.getName(), metric); } return copy; }
public synchronized void setNumericMetric(String name, long amt) { MetricsLongValue m = (MetricsLongValue)registry.get(name); if (m == null) { m = new MetricsLongValue(name, this.registry); this.needsUpdateMessage = true; } m.set(amt); }
public synchronized void incrTimeVaryingMetric( String name, long amt, int numOps) { MetricsTimeVaryingRate m = (MetricsTimeVaryingRate)registry.get(name); if (m == null) { m = new MetricsTimeVaryingRate(name, this.registry); this.needsUpdateMessage = true; } if (numOps > 0) { m.inc(numOps, amt); } }
private void updateMbeanInfoIfMetricsListChanged() { if (numEntriesInRegistry != metricsRegistry.size()) createMBeanInfo(); }
/** * Report that a filtered SEP operation has been processed. This method should only be called to * report SEP operations that have been processed after making it through the filtering process. * * @param duration The number of millisecods spent handling the SEP operation */ public void reportFilteredSepOperation(long duration) { sepProcessingRate.inc(duration); }
public void shutdown() { if (mbeanName != null) MBeanUtil.unregisterMBean(mbeanName); } }
/** * Constructor - create a new metric * @param nam the name of the metrics to be used to publish the metric * @param registry - where the metrics object will be registered */ public MetricsLongValue(final String nam, final MetricsRegistry registry, final String description) { super(nam, description); value = 0; changed = false; registry.add(nam, this); }
/** * Increment the metrics for one operation * @param time for one operation */ public synchronized void inc(final long time) { currentData.numOperations++; currentData.time += time; minMax.update(time); }
private synchronized void intervalHeartBeat() { previousIntervalData.numOperations = currentData.numOperations; previousIntervalData.time = (currentData.numOperations == 0) ? 0 : currentData.time / currentData.numOperations; currentData.reset(); }
/** * Constructor - create a new metric * @param nam the name of the metrics to be used to publish the metric * @param registry - where the metrics object will be registered */ public MetricsTimeVaryingRate(final String nam, final MetricsRegistry registry, final String description) { super(nam, description); currentData = new Metrics(); previousIntervalData = new Metrics(); minMax = new MinMax(); registry.add(nam, this); }
private void updateMbeanInfoIfMetricsListChanged() { if (numEntriesInRegistry != metricsRegistry.size()) createMBeanInfo(); }
public void shutdown() { if (mbeanName != null) MBeanUtil.unregisterMBean(mbeanName); } }
/** * Increment the metrics for numOps operations * @param numOps - number of operations * @param time - time for numOps operations */ public synchronized void inc(final int numOps, final long time) { currentData.numOperations += numOps; currentData.time += time; long timePerOps = time/numOps; minMax.update(timePerOps); }
/** * Constructor - create a new metric * @param nam the name of the metrics to be used to publish the metric * @param registry - where the metrics object will be registered */ public MetricsTimeVaryingRate(final String nam, final MetricsRegistry registry, final String description) { super(nam, description); currentData = new Metrics(); previousIntervalData = new Metrics(); minMax = new MinMax(); registry.add(nam, this); }
private void updateMbeanInfoIfMetricsListChanged() { if (numEntriesInRegistry != metricsRegistry.size()) createMBeanInfo(); }
/** * Constructor - create a new metric * @param nam the name of the metrics to be used to publish the metric * @param registry - where the metrics object will be registered */ public MetricsTimeVaryingRate(final String nam, final MetricsRegistry registry, final String description) { super(nam, description); currentData = new Metrics(); previousIntervalData = new Metrics(); minMax = new MinMax(); registry.add(nam, this); }
private void updateMbeanInfoIfMetricsListChanged() { if (numEntriesInRegistry != metricsRegistry.size()) createMBeanInfo(); }
private void updateMbeanInfoIfMetricsListChanged() { if (numEntriesInRegistry != metricsRegistry.size()) createMBeanInfo(); }