Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SHORT-CIRCUITs from Health check calculation #1034

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:
* <p><ul>
* <li>{@link HystrixRollingNumberEvent#SUCCESS}
* <li>{@link HystrixRollingNumberEvent#FAILURE}
* <li>{@link HystrixRollingNumberEvent#TIMEOUT}
* <li>{@link HystrixRollingNumberEvent#THREAD_POOL_REJECTED}
* <li>{@link HystrixRollingNumberEvent#SEMAPHORE_REJECTED}
* </ul><p>
* The following are not included in either attempts/failures:
* <p><ul>
* <li>{@link HystrixRollingNumberEvent#BAD_REQUEST} - this event denotes bad arguments to the command and not a problem with the command
* <li>{@link HystrixRollingNumberEvent#SHORT_CIRCUITED} - this event measures a health problem in the past, not a problem with the current state
* <li>All Fallback metrics
* <li>{@link HystrixRollingNumberEvent#EMIT} - this event is not a terminal state for the command
* <li>{@link HystrixRollingNumberEvent#COLLAPSED} - this event is about the batching process, not the command execution
* </ul><p>
*
* @return {@link HealthCounts}
*/
Expand All @@ -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) {
Expand Down