From a7fc7d15cdf226c5ef74592c535a20593448b5a0 Mon Sep 17 00:00:00 2001 From: Matt Jacobs Date: Mon, 4 Jan 2016 09:56:49 -0800 Subject: [PATCH] Remove SHORT-CIRCUITS from Health check calculation --- .../hystrix/HystrixCommandMetrics.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandMetrics.java b/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandMetrics.java index 15b884863..f23e63b9d 100644 --- a/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandMetrics.java +++ b/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandMetrics.java @@ -440,6 +440,23 @@ public long getRollingMaxConcurrentExecutions() { /** * Retrieve a snapshot of total requests, error count and error percentage. + * + * This metrics should measure the actual health of a {@link HystrixCommand}. For that reason, the following are included: + *

+ * The following are not included in either attempts/failures: + *

* * @return {@link HealthCounts} */ @@ -457,9 +474,8 @@ public HealthCounts getHealthCounts() { long timeout = counter.getRollingSum(HystrixRollingNumberEvent.TIMEOUT); // fallbacks occur on this long threadPoolRejected = counter.getRollingSum(HystrixRollingNumberEvent.THREAD_POOL_REJECTED); // fallbacks occur on this long semaphoreRejected = counter.getRollingSum(HystrixRollingNumberEvent.SEMAPHORE_REJECTED); // fallbacks occur on this - long shortCircuited = counter.getRollingSum(HystrixRollingNumberEvent.SHORT_CIRCUITED); // fallbacks occur on this - long totalCount = failure + success + timeout + threadPoolRejected + shortCircuited + semaphoreRejected; - long errorCount = failure + timeout + threadPoolRejected + shortCircuited + semaphoreRejected; + long totalCount = failure + success + timeout + threadPoolRejected + semaphoreRejected; + long errorCount = failure + timeout + threadPoolRejected + semaphoreRejected; int errorPercentage = 0; if (totalCount > 0) {