/** * Constructor - create a new metric * @param name the name of the metrics to be used to publish the metric * @param registry - where the metrics object will be registered * @param description - description of the metric * @param printMinMax - Print the min-max for this metric? */ public MetricsTimeVaryingRate(final String name, final MetricsRegistry registry, final String description, final boolean printMinMax) { super(name, description); currentData = new Metrics(); previousIntervalData = new Metrics(); minMax = new MinMax(); this.printMinMax = printMinMax; lock = new ReentrantLock(false); registry.add(name, this); }
private void intervalHeartBeat() { lock.lock(); try { previousIntervalData.numOperations = currentData.numOperations; previousIntervalData.time = (currentData.numOperations == 0) ? 0 : currentData.time / currentData.numOperations; currentData.reset(); } finally { lock.unlock(); } }
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); }
/** * 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 synchronized void intervalHeartBeat() { previousIntervalData.numOperations = currentData.numOperations; previousIntervalData.time = (currentData.numOperations == 0) ? 0 : currentData.time / currentData.numOperations; currentData.reset(); }
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 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 synchronized void intervalHeartBeat() { previousIntervalData.numOperations = currentData.numOperations; previousIntervalData.time = (currentData.numOperations == 0) ? 0 : currentData.time / currentData.numOperations; currentData.reset(); }