HADOOP-3957. Change MutableQuantiles to use a shared thread for rolling over metrics. Contributed by Andrew Wang.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1390210 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
33a3efcd18
commit
9270635f33
|
@ -244,6 +244,9 @@ Trunk (Unreleased)
|
||||||
required context item is not configured
|
required context item is not configured
|
||||||
(Brahma Reddy Battula via harsh)
|
(Brahma Reddy Battula via harsh)
|
||||||
|
|
||||||
|
HADOOP-3957. Change MutableQuantiles to use a shared thread for rolling
|
||||||
|
over metrics. (Andrew Wang via todd)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
HADOOP-7761. Improve the performance of raw comparisons. (todd)
|
HADOOP-7761. Improve the performance of raw comparisons. (todd)
|
||||||
|
|
|
@ -35,6 +35,7 @@ import org.apache.hadoop.metrics2.util.Quantile;
|
||||||
import org.apache.hadoop.metrics2.util.SampleQuantiles;
|
import org.apache.hadoop.metrics2.util.SampleQuantiles;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Watches a stream of long values, maintaining online estimates of specific
|
* Watches a stream of long values, maintaining online estimates of specific
|
||||||
|
@ -60,8 +61,9 @@ public class MutableQuantiles extends MutableMetric {
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
protected Map<Quantile, Long> previousSnapshot = null;
|
protected Map<Quantile, Long> previousSnapshot = null;
|
||||||
|
|
||||||
private final ScheduledExecutorService scheduler = Executors
|
private static final ScheduledExecutorService scheduler = Executors
|
||||||
.newScheduledThreadPool(1);
|
.newScheduledThreadPool(1, new ThreadFactoryBuilder().setDaemon(true)
|
||||||
|
.setNameFormat("MutableQuantiles-%d").build());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new {@link MutableQuantiles} for a metric that rolls itself
|
* Instantiates a new {@link MutableQuantiles} for a metric that rolls itself
|
||||||
|
|
Loading…
Reference in New Issue