/** * 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); }
/** * Reset the min max values */ public void resetMinMax() { lock.lock(); try { minMax.reset(); } finally { lock.unlock(); } } }
/** * Increment the metrics for numOps operations * @param numOps - number of operations * @param time - time for numOps operations */ public void inc(final int numOps, final long time) { lock.lock(); try { currentData.numOperations += numOps; currentData.time += time; long timePerOps = time/numOps; minMax.update(timePerOps); } finally { lock.unlock(); } }
/** * Increment the metrics for one operation * @param time for one operation */ public void inc(final long time) { lock.lock(); try { currentData.numOperations++; currentData.time += time; minMax.update(time); } finally { lock.unlock(); } }
/** * 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); }
/** * 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); }
/** * Reset the min max values */ public synchronized void resetMinMax() { minMax.reset(); } }
/** * 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); }
/** * Reset the min max values */ public synchronized void resetMinMax() { minMax.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); }
/** * 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); }
/** * Reset the min max values */ public synchronized void resetMinMax() { minMax.reset(); } }
/** * 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); }
/** * Reset the min max values */ public synchronized void resetMinMax() { minMax.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); }
/** * 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 n the name of the metrics to be used to publish the metric */ public MetricsTimeVaryingRate(final String n) { name = n; currentData = new Metrics(); previousIntervalData = new Metrics(); minMax = new MinMax(); }
/** * 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); }
/** * 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); }