public class HystrixThreadPoolMetrics extends HystrixMetrics
HystrixThreadPool
to record metrics.Modifier and Type | Field and Description |
---|---|
static rx.functions.Func2<long[],com.netflix.hystrix.metric.HystrixCommandCompletion,long[]> |
appendEventToBucket |
static rx.functions.Func2<long[],long[],long[]> |
counterAggregator |
counter
Modifier and Type | Method and Description |
---|---|
long |
getCumulativeCount(HystrixEventType.ThreadPool event) |
long |
getCumulativeCount(com.netflix.hystrix.util.HystrixRollingNumberEvent event)
Get the cumulative count since the start of the application for the given
HystrixRollingNumberEvent . |
long |
getCumulativeCountThreadsExecuted()
Cumulative count of number of threads executed since the start of the application.
|
long |
getCumulativeCountThreadsRejected()
Cumulative count of number of threads rejected since the start of the application.
|
java.lang.Number |
getCurrentActiveCount()
Value from
ThreadPoolExecutor.getActiveCount() |
java.lang.Number |
getCurrentCompletedTaskCount()
Value from
ThreadPoolExecutor.getCompletedTaskCount() |
static rx.functions.Func0<java.lang.Integer> |
getCurrentConcurrencyThunk(HystrixThreadPoolKey threadPoolKey) |
java.lang.Number |
getCurrentCorePoolSize()
Value from
ThreadPoolExecutor.getCorePoolSize() |
java.lang.Number |
getCurrentLargestPoolSize()
Value from
ThreadPoolExecutor.getLargestPoolSize() |
java.lang.Number |
getCurrentMaximumPoolSize()
Value from
ThreadPoolExecutor.getMaximumPoolSize() |
java.lang.Number |
getCurrentPoolSize()
Value from
ThreadPoolExecutor.getPoolSize() |
java.lang.Number |
getCurrentQueueSize()
Current size of
BlockingQueue used by the thread-pool |
java.lang.Number |
getCurrentTaskCount()
Value from
ThreadPoolExecutor.getTaskCount() |
static HystrixThreadPoolMetrics |
getInstance(HystrixThreadPoolKey key)
Get the
HystrixThreadPoolMetrics instance for a given HystrixThreadPoolKey or null if one does not exist. |
static HystrixThreadPoolMetrics |
getInstance(HystrixThreadPoolKey key,
java.util.concurrent.ThreadPoolExecutor threadPool,
HystrixThreadPoolProperties properties)
Get or create the
HystrixThreadPoolMetrics instance for a given HystrixThreadPoolKey . |
static java.util.Collection<HystrixThreadPoolMetrics> |
getInstances()
All registered instances of
HystrixThreadPoolMetrics |
HystrixThreadPoolProperties |
getProperties()
HystrixThreadPoolProperties of the HystrixThreadPool these metrics represent. |
long |
getRollingCount(HystrixEventType.ThreadPool event) |
long |
getRollingCount(com.netflix.hystrix.util.HystrixRollingNumberEvent event)
Get the rolling count for the given
HystrixRollingNumberEvent . |
long |
getRollingCountThreadsExecuted()
Rolling count of number of threads executed during rolling statistical window.
|
long |
getRollingCountThreadsRejected()
Rolling count of number of threads rejected during rolling statistical window.
|
long |
getRollingMaxActiveThreads()
Rolling max number of active threads during rolling statistical window.
|
java.util.concurrent.ThreadPoolExecutor |
getThreadPool()
ThreadPoolExecutor this executor represents. |
HystrixThreadPoolKey |
getThreadPoolKey()
HystrixThreadPoolKey these metrics represent. |
void |
markThreadCompletion()
Invoked each time a thread completes.
|
void |
markThreadExecution()
Invoked each time a thread is executed.
|
void |
markThreadRejection()
Invoked each time a command is rejected from the thread-pool
|
public static final rx.functions.Func2<long[],com.netflix.hystrix.metric.HystrixCommandCompletion,long[]> appendEventToBucket
public static final rx.functions.Func2<long[],long[],long[]> counterAggregator
public static HystrixThreadPoolMetrics getInstance(HystrixThreadPoolKey key, java.util.concurrent.ThreadPoolExecutor threadPool, HystrixThreadPoolProperties properties)
HystrixThreadPoolMetrics
instance for a given HystrixThreadPoolKey
.
This is thread-safe and ensures only 1 HystrixThreadPoolMetrics
per HystrixThreadPoolKey
.
key
- HystrixThreadPoolKey
of HystrixThreadPool
instance requesting the HystrixThreadPoolMetrics
threadPool
- Pass-thru of ThreadPoolExecutor to HystrixThreadPoolMetrics
instance on first time when constructedproperties
- Pass-thru to HystrixThreadPoolMetrics
instance on first time when constructedHystrixThreadPoolMetrics
public static HystrixThreadPoolMetrics getInstance(HystrixThreadPoolKey key)
HystrixThreadPoolMetrics
instance for a given HystrixThreadPoolKey
or null if one does not exist.key
- HystrixThreadPoolKey
of HystrixThreadPool
instance requesting the HystrixThreadPoolMetrics
HystrixThreadPoolMetrics
public static java.util.Collection<HystrixThreadPoolMetrics> getInstances()
HystrixThreadPoolMetrics
Collection<HystrixThreadPoolMetrics>
public java.util.concurrent.ThreadPoolExecutor getThreadPool()
ThreadPoolExecutor
this executor represents.public HystrixThreadPoolKey getThreadPoolKey()
HystrixThreadPoolKey
these metrics represent.public HystrixThreadPoolProperties getProperties()
HystrixThreadPoolProperties
of the HystrixThreadPool
these metrics represent.public java.lang.Number getCurrentActiveCount()
ThreadPoolExecutor.getActiveCount()
public java.lang.Number getCurrentCompletedTaskCount()
ThreadPoolExecutor.getCompletedTaskCount()
public java.lang.Number getCurrentCorePoolSize()
ThreadPoolExecutor.getCorePoolSize()
public java.lang.Number getCurrentLargestPoolSize()
ThreadPoolExecutor.getLargestPoolSize()
public java.lang.Number getCurrentMaximumPoolSize()
ThreadPoolExecutor.getMaximumPoolSize()
public java.lang.Number getCurrentPoolSize()
ThreadPoolExecutor.getPoolSize()
public java.lang.Number getCurrentTaskCount()
ThreadPoolExecutor.getTaskCount()
public java.lang.Number getCurrentQueueSize()
BlockingQueue
used by the thread-poolpublic void markThreadExecution()
public long getRollingCountThreadsExecuted()
The rolling window is defined by HystrixThreadPoolProperties.metricsRollingStatisticalWindowInMilliseconds()
.
public long getCumulativeCountThreadsExecuted()
public long getRollingCountThreadsRejected()
The rolling window is defined by HystrixThreadPoolProperties.metricsRollingStatisticalWindowInMilliseconds()
.
public long getCumulativeCountThreadsRejected()
public long getRollingCount(HystrixEventType.ThreadPool event)
public long getCumulativeCount(HystrixEventType.ThreadPool event)
public long getCumulativeCount(com.netflix.hystrix.util.HystrixRollingNumberEvent event)
HystrixMetrics
HystrixRollingNumberEvent
.getCumulativeCount
in class HystrixMetrics
event
- HystrixRollingNumberEvent
of the event to retrieve a sum forpublic long getRollingCount(com.netflix.hystrix.util.HystrixRollingNumberEvent event)
HystrixMetrics
HystrixRollingNumberEvent
.
The rolling window is defined by HystrixCommandProperties.metricsRollingStatisticalWindowInMilliseconds()
.
getRollingCount
in class HystrixMetrics
event
- HystrixRollingNumberEvent
of the event to retrieve a sum forpublic void markThreadCompletion()
public long getRollingMaxActiveThreads()
The rolling window is defined by HystrixThreadPoolProperties.metricsRollingStatisticalWindowInMilliseconds()
.
public void markThreadRejection()
public static rx.functions.Func0<java.lang.Integer> getCurrentConcurrencyThunk(HystrixThreadPoolKey threadPoolKey)