/** * Retrieve the total end-to-end execution time (in milliseconds) for {@link * HystrixCommand#execute()} or {@link HystrixCommand#queue()} at a given percentile. * * <p>When execution is successful this would include time from {@link * #getExecutionTimePercentile} but when execution is being rejected, short-circuited, or * timed-out then the time will differ. * * <p>This time can be lower than {@link #getExecutionTimePercentile} when a timeout occurs and * the backing thread that calls {@link HystrixCommand#run()} is still running. * * <p>When rejections or short-circuits occur then {@link HystrixCommand#run()} will not be * executed and thus not contribute time to {@link #getExecutionTimePercentile} but time will * still show up in this metric for the end-to-end time. * * <p>This metric gives visibility into the total cost of {@link HystrixCommand} execution * including the overhead of queuing, executing and waiting for a thread to invoke {@link * HystrixCommand#run()} . * * <p>Percentile capture and calculation is configured via {@link * HystrixCommandProperties#metricsRollingStatisticalWindowInMilliseconds()} and other related * properties. * * @param percentile Percentile such as 50, 99, or 99.5. * @return int time in milliseconds */ public int getTotalTimePercentile(double percentile) { return percentileTotal.getPercentile(percentile); }
/** * Retrieve the execution time (in milliseconds) for the {@link HystrixCommand#run()} method being * invoked at a given percentile. * * <p>Percentile capture and calculation is configured via {@link * HystrixCommandProperties#metricsRollingStatisticalWindowInMilliseconds()} and other related * properties. * * @param percentile Percentile such as 50, 99, or 99.5. * @return int time in milliseconds */ public int getExecutionTimePercentile(double percentile) { return percentileExecution.getPercentile(percentile); }