
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.hystrix.HystrixCommandMetrics
public class HystrixCommandMetrics
Used by HystrixCommand to record metrics.
| Nested Class Summary | |
|---|---|
static class |
HystrixCommandMetrics.HealthCounts
Number of requests during rolling window. |
| Method Summary | |
|---|---|
HystrixCommandGroupKey |
getCommandGroup()
HystrixCommandGroupKey of the HystrixCommand these metrics represent. |
HystrixCommandKey |
getCommandKey()
HystrixCommandKey these metrics represent. |
long |
getCumulativeCount(HystrixRollingNumberEvent event)
Get the cumulative count since the start of the application for the given HystrixRollingNumberEvent. |
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 |
getRollingCount(HystrixRollingNumberEvent event)
Get the rolling count for the given HystrixRollingNumberEvent. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
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 HystrixCommandMetricscommandGroup - Pass-thru to HystrixCommandMetrics instance on first time when constructedproperties - Pass-thru to HystrixCommandMetrics instance on first time when constructed
HystrixCommandMetricspublic 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
HystrixCommandMetricspublic static java.util.Collection<HystrixCommandMetrics> getInstances()
HystrixCommandMetrics
Collection<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 long getCumulativeCount(HystrixRollingNumberEvent event)
HystrixRollingNumberEvent.
event - HystrixRollingNumberEvent of the event to retrieve a sum for
public long getRollingCount(HystrixRollingNumberEvent event)
HystrixRollingNumberEvent.
The rolling window is defined by HystrixCommandProperties.metricsRollingStatisticalWindowInMilliseconds().
event - HystrixRollingNumberEvent of the event to retrieve a sum for
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 HystrixCommandMetrics.HealthCounts getHealthCounts()
HystrixCommandMetrics.HealthCounts
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||