public class HystrixCommandMetrics extends HystrixMetrics
HystrixCommand
to record metrics.Modifier and Type | Class and Description |
---|---|
static class |
HystrixCommandMetrics.HealthCounts
Number of requests during rolling window.
|
counter
getCumulativeCount, getRollingCount
public static HystrixCommandMetrics getInstance(HystrixCommandKey key, HystrixCommandGroupKey commandGroup, HystrixCommandProperties properties)
HystrixCommandMetrics
instance for a given HystrixCommandKey
.
This is thread-safe and ensures only 1 HystrixCommandMetrics
per HystrixCommandKey
.
key
- HystrixCommandKey
of HystrixCommand
instance requesting the HystrixCommandMetrics
commandGroup
- Pass-thru to HystrixCommandMetrics
instance on first time when constructedproperties
- Pass-thru to HystrixCommandMetrics
instance on first time when constructedHystrixCommandMetrics
public static HystrixCommandMetrics getInstance(HystrixCommandKey key, HystrixCommandGroupKey commandGroup, HystrixThreadPoolKey threadPoolKey, HystrixCommandProperties properties)
HystrixCommandMetrics
instance for a given HystrixCommandKey
.
This is thread-safe and ensures only 1 HystrixCommandMetrics
per HystrixCommandKey
.
key
- HystrixCommandKey
of HystrixCommand
instance requesting the HystrixCommandMetrics
commandGroup
- Pass-thru to HystrixCommandMetrics
instance on first time when constructedproperties
- Pass-thru to HystrixCommandMetrics
instance on first time when constructedHystrixCommandMetrics
public static HystrixCommandMetrics getInstance(HystrixCommandKey key)
HystrixCommandMetrics
instance for a given HystrixCommandKey
or null if one does not exist.key
- HystrixCommandKey
of HystrixCommand
instance requesting the HystrixCommandMetrics
HystrixCommandMetrics
public static Collection<HystrixCommandMetrics> getInstances()
HystrixCommandMetrics
Collection<HystrixCommandMetrics>
public HystrixCommandKey getCommandKey()
HystrixCommandKey
these metrics represent.public HystrixCommandGroupKey getCommandGroup()
HystrixCommandGroupKey
of the HystrixCommand
these metrics represent.public HystrixThreadPoolKey getThreadPoolKey()
HystrixThreadPoolKey
used by HystrixCommand
these metrics represent.public HystrixCommandProperties getProperties()
HystrixCommandProperties
of the HystrixCommand
these metrics represent.public int getExecutionTimePercentile(double percentile)
HystrixCommand.run()
method being invoked at a given percentile.
Percentile capture and calculation is configured via HystrixCommandProperties.metricsRollingStatisticalWindowInMilliseconds()
and other related properties.
percentile
- Percentile such as 50, 99, or 99.5.public int getExecutionTimeMean()
HystrixCommand.run()
.
This uses the same backing data as getExecutionTimePercentile(double)
;
public int getTotalTimePercentile(double percentile)
HystrixCommand.execute()
or HystrixCommand.queue()
at a given percentile.
When execution is successful this would include time from getExecutionTimePercentile(double)
but when execution
is being rejected, short-circuited, or timed-out then the time will differ.
This time can be lower than getExecutionTimePercentile(double)
when a timeout occurs and the backing
thread that calls HystrixCommand.run()
is still running.
When rejections or short-circuits occur then HystrixCommand.run()
will not be executed and thus
not contribute time to getExecutionTimePercentile(double)
but time will still show up in this metric for the end-to-end time.
This metric gives visibility into the total cost of HystrixCommand
execution including
the overhead of queuing, executing and waiting for a thread to invoke HystrixCommand.run()
.
Percentile capture and calculation is configured via HystrixCommandProperties.metricsRollingStatisticalWindowInMilliseconds()
and other related properties.
percentile
- Percentile such as 50, 99, or 99.5.public int getTotalTimeMean()
HystrixCommand.execute()
or HystrixCommand.queue()
.
This uses the same backing data as getTotalTimePercentile(double)
;
public int getCurrentConcurrentExecutionCount()
HystrixCommand.run()
;public long getRollingMaxConcurrentExecutions()
public HystrixCommandMetrics.HealthCounts getHealthCounts()
Copyright © 2017. All Rights Reserved.