
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.
|
countergetCumulativeCount, getRollingCountpublic 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 HystrixCommandMetricscommandGroup - Pass-thru to HystrixCommandMetrics instance on first time when constructedproperties - Pass-thru to HystrixCommandMetrics instance on first time when constructedHystrixCommandMetricspublic 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 HystrixCommandMetricscommandGroup - Pass-thru to HystrixCommandMetrics instance on first time when constructedproperties - Pass-thru to HystrixCommandMetrics instance on first time when constructedHystrixCommandMetricspublic 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 HystrixCommandMetricsHystrixCommandMetricspublic static java.util.Collection<HystrixCommandMetrics> getInstances()
HystrixCommandMetricsCollection<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 HystrixCommandMetrics.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 HystrixCommandMetrics.getExecutionTimePercentile(double) but when execution
is being rejected, short-circuited, or timed-out then the time will differ.
This time can be lower than HystrixCommandMetrics.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 HystrixCommandMetrics.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 HystrixCommandMetrics.getTotalTimePercentile(double);
public int getCurrentConcurrentExecutionCount()
HystrixCommand.run();public long getRollingMaxConcurrentExecutions()
public HystrixCommandMetrics.HealthCounts getHealthCounts()