-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow multiple circuits to aggregate stats (#140)
If a user creates multiple circuits in the same process, they should aggregate their stats in the Hystrix stream. Fixes: #125 Ref: #124 Now that we are piping all event data for all circuits through a single `TransformStream`, a LOT of events are being listened for. I've bumped the limit to 100.
- Loading branch information
Showing
15 changed files
with
620 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
function hystrixStream (circuitBreaker) { | ||
return (request, response) => { | ||
response.writeHead(200, { | ||
'Content-Type': 'text/event-stream', | ||
'Cache-Control': 'no-cache', | ||
'Connection': 'keep-alive'}); | ||
response.write('retry: 10000\n'); | ||
response.write('event: connecttime\n'); | ||
|
||
circuitBreaker.stats.pipe(response); | ||
}; | ||
} | ||
|
||
module.exports = hystrixStream; |
Oops, something went wrong.