{"action":"created","issue":{"url":"https://api.github.com/repos/Netflix/Hystrix/issues/1031","labels_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1031/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1031/comments","events_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1031/events","html_url":"https://github.com/Netflix/Hystrix/issues/1031","id":124362387,"number":1031,"title":"Using shortcircuited in errorpercentage makes it hard to close circuit again","user":{"login":"JorritSalverda","id":136472,"avatar_url":"https://avatars.githubusercontent.com/u/136472?v=3","gravatar_id":"","url":"https://api.github.com/users/JorritSalverda","html_url":"https://github.com/JorritSalverda","followers_url":"https://api.github.com/users/JorritSalverda/followers","following_url":"https://api.github.com/users/JorritSalverda/following{/other_user}","gists_url":"https://api.github.com/users/JorritSalverda/gists{/gist_id}","starred_url":"https://api.github.com/users/JorritSalverda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JorritSalverda/subscriptions","organizations_url":"https://api.github.com/users/JorritSalverda/orgs","repos_url":"https://api.github.com/users/JorritSalverda/repos","events_url":"https://api.github.com/users/JorritSalverda/events{/privacy}","received_events_url":"https://api.github.com/users/JorritSalverda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-30T15:35:50Z","updated_at":"2016-01-01T10:07:14Z","closed_at":null,"body":"In HystrixCommandMetrics.java method getHealthCounts the errorpercentage is calculated as follows.\r\n\r\n```java\r\nlong totalCount = failure + success + timeout + threadPoolRejected + shortCircuited + semaphoreRejected;\r\nlong errorCount = failure + timeout + threadPoolRejected + shortCircuited + semaphoreRejected;\r\nint errorPercentage = 0;\r\n\r\nif (totalCount > 0) {\r\n    errorPercentage = (int) ((double) errorCount / totalCount * 100);\r\n}\r\n```\r\n\r\nTo me it seems that using shortCircuited and both rejected values in the errorCount obscures the real error rate at the dependency itself, making it possible that as soon as the circuit breaker closes due to a successful canary call it closes again.\r\n\r\nWhat's your experience with this?"},"comment":{"url":"https://api.github.com/repos/Netflix/Hystrix/issues/comments/168296875","html_url":"https://github.com/Netflix/Hystrix/issues/1031#issuecomment-168296875","issue_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1031","id":168296875,"user":{"login":"JorritSalverda","id":136472,"avatar_url":"https://avatars.githubusercontent.com/u/136472?v=3","gravatar_id":"","url":"https://api.github.com/users/JorritSalverda","html_url":"https://github.com/JorritSalverda","followers_url":"https://api.github.com/users/JorritSalverda/followers","following_url":"https://api.github.com/users/JorritSalverda/following{/other_user}","gists_url":"https://api.github.com/users/JorritSalverda/gists{/gist_id}","starred_url":"https://api.github.com/users/JorritSalverda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JorritSalverda/subscriptions","organizations_url":"https://api.github.com/users/JorritSalverda/orgs","repos_url":"https://api.github.com/users/JorritSalverda/repos","events_url":"https://api.github.com/users/JorritSalverda/events{/privacy}","received_events_url":"https://api.github.com/users/JorritSalverda/received_events","type":"User","site_admin":false},"created_at":"2016-01-01T10:07:14Z","updated_at":"2016-01-01T10:07:14Z","body":"I think it would depend on a fallback being executed successfully or an exception thrown instead whether it should count as an error. Executing the fallback is more of a warning if you compare it to the levels used in logging."}}