
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| Modifier and Type | Method and Description |
|---|---|
HystrixCommandGroupKey |
getCommandGroup()
HystrixCommandGroupKey of the HystrixCommand these metrics represent. |
HystrixCommandKey |
getCommandKey()
HystrixCommandKey these metrics represent. |
int |
getCurrentConcurrentExecutionCount()
Current number of concurrent executions of
HystrixCommand.run(); |
int |
getExecutionTimeMean()
The mean (average) execution time (in milliseconds) for the
HystrixCommand.run(). |
int |
getExecutionTimePercentile(double percentile)
Retrieve the execution time (in milliseconds) for the
HystrixCommand.run() method being invoked at a given percentile. |
HystrixCommandMetrics.HealthCounts |
getHealthCounts()
Retrieve a snapshot of total requests, error count and error percentage.
|
static HystrixCommandMetrics |
getInstance(HystrixCommandKey key)
Get the
HystrixCommandMetrics instance for a given HystrixCommandKey or null if one does not exist. |
static HystrixCommandMetrics |
getInstance(HystrixCommandKey key,
HystrixCommandGroupKey commandGroup,
HystrixCommandProperties properties)
Get or create the
HystrixCommandMetrics instance for a given HystrixCommandKey. |
static java.util.Collection<HystrixCommandMetrics> |
getInstances()
All registered instances of
HystrixCommandMetrics |
HystrixCommandProperties |
getProperties()
HystrixCommandProperties of the HystrixCommand these metrics represent. |
long |
getRollingMaxConcurrentExecutions() |
int |
getTotalTimeMean()
The mean (average) execution time (in milliseconds) for
HystrixCommand.execute() or HystrixCommand.queue(). |
int |
getTotalTimePercentile(double percentile)
Retrieve the total end-to-end execution time (in milliseconds) for
HystrixCommand.execute() or HystrixCommand.queue() at a given percentile. |
getCumulativeCount, 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)
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 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()