/** * Add the file read latency to {@link MutableQuantiles} metrics. * * @param readLatency file read latency in microseconds */ public void addReadFileLatency(long readLatency) { if (fileReadQuantiles!= null) { for (MutableQuantiles q : fileReadQuantiles) { q.add(readLatency); } } }
/** * 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; }
@Override public synchronized void snapshot(MetricsRecordBuilder builder, boolean all) { if (all || changed()) { builder.addGauge(numInfo, previousCount); for (int i = 0; i < quantiles.length; i++) { long newValue = 0; // If snapshot is null, we failed to update since the window was empty if (previousSnapshot != null) { newValue = previousSnapshot.get(quantiles[i]); } builder.addGauge(quantileInfos[i], newValue); } if (changed()) { clearChanged(); } } }
private void getIoStats(MetricsRecordBuilder rb) { rb.addGauge(MaxDecodingTime, maxDecodingTime.value()); rateOfDecoding.snapshot(rb, true); for (MutableQuantiles q : decodingTimes) { q.snapshot(rb, true); } }
@Override public void run() { synchronized (parent) { parent.previousCount = parent.estimator.getCount(); parent.previousSnapshot = parent.estimator.snapshot(); parent.estimator.clear(); } parent.setChanged(); }
@Override public void run() { synchronized (parent) { parent.previousCount = parent.estimator.getCount(); parent.previousSnapshot = parent.estimator.snapshot(); parent.estimator.clear(); } parent.setChanged(); }
/** * Add the file write latency to {@link MutableQuantiles} metrics. * * @param writeLatency file write latency in microseconds */ public void addWriteFileLatency(long writeLatency) { if (fileWriteQuantiles != null) { for (MutableQuantiles q : fileWriteQuantiles) { q.add(writeLatency); } } }
@Override public synchronized void snapshot(MetricsRecordBuilder builder, boolean all) { if (all || changed()) { builder.addGauge(numInfo, previousCount); for (int i = 0; i < quantiles.length; i++) { long newValue = 0; // If snapshot is null, we failed to update since the window was empty if (previousSnapshot != null) { newValue = previousSnapshot.get(quantiles[i]); } builder.addGauge(quantileInfos[i], newValue); } if (changed()) { clearChanged(); } } }
@Override public void getMetrics(MetricsCollector collector, boolean all) { MetricsRecordBuilder builder = collector.addRecord(RECORD).setContext(CONTEXT); snapshot(); registry.snapshot(builder, all); replicationQueueTimeQuantiles.snapshot(builder, all); replicationQueueTimeStat.snapshot(builder, all); }
@Override public void run() { synchronized (parent) { parent.previousCount = parent.estimator.getCount(); parent.previousSnapshot = parent.estimator.snapshot(); parent.estimator.clear(); } parent.setChanged(); }
/** * 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 */ public synchronized MutableQuantiles newQuantiles(String name, String desc, String sampleName, String valueName, int interval) { checkMetricName(name); MutableQuantiles ret = new MutableQuantiles(name, desc, sampleName, valueName, interval); metricsMap.put(name, ret); return ret; }
public void addScanRowCount(long count) { scanRowCount.add(count); for (MutableQuantiles m : scanRowCountQuantiles) { m.add(count); } }
@Override public synchronized void snapshot(MetricsRecordBuilder builder, boolean all) { if (all || changed()) { builder.addGauge(numInfo, previousCount); for (int i = 0; i < quantiles.length; i++) { long newValue = 0; // If snapshot is null, we failed to update since the window was empty if (previousSnapshot != null) { newValue = previousSnapshot.get(quantiles[i]); } builder.addGauge(quantileInfos[i], newValue); } if (changed()) { clearChanged(); } } }
private void getIoStats(MetricsRecordBuilder rb) { rb.addGauge(MaxDecodingTime, maxDecodingTime.value()); rateOfDecoding.snapshot(rb, true); for (MutableQuantiles q : decodingTimes) { q.snapshot(rb, true); } }
@Override public void run() { synchronized (parent) { parent.previousCount = parent.estimator.getCount(); parent.previousSnapshot = parent.estimator.snapshot(); parent.estimator.clear(); } parent.setChanged(); }
/** * 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 */ public synchronized MutableQuantiles newQuantiles(String name, String desc, String sampleName, String valueName, int interval) { checkMetricName(name); MutableQuantiles ret = new MutableQuantiles(name, desc, sampleName, valueName, interval); metricsMap.put(name, ret); return ret; }
public void addCacheHitCount(long count) { cacheHitCount.incr(count); for (MutableQuantiles m : cacheHitCountQuantiles) { m.add(count); } }
@Override public synchronized void snapshot(MetricsRecordBuilder builder, boolean all) { if (all || changed()) { builder.addGauge(numInfo, previousCount); for (int i = 0; i < quantiles.length; i++) { long newValue = 0; // If snapshot is null, we failed to update since the window was empty if (previousSnapshot != null) { newValue = previousSnapshot.get(quantiles[i]); } builder.addGauge(quantileInfos[i], newValue); } if (changed()) { clearChanged(); } } }
@Override public void getMetrics(MetricsCollector collector, boolean all) { MetricsRecordBuilder builder = collector.addRecord(RECORD).setContext(CONTEXT); snapshot(); registry.snapshot(builder, all); replicationQueueTimeQuantiles.snapshot(builder, all); replicationQueueTimeStat.snapshot(builder, all); }