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

Get HystrixStats #124

Closed
DavideCarvalho opened this issue Dec 15, 2017 · 6 comments
Closed

Get HystrixStats #124

DavideCarvalho opened this issue Dec 15, 2017 · 6 comments
Assignees

Comments

@DavideCarvalho
Copy link

DavideCarvalho commented Dec 15, 2017

Is there any way of getting HystrixStats to open the stream url without opening a circuit?
I Tried the folowing code but it give's me an error "TypeError: Cannot read property 'name' of undefined"

const circuitBreaker = require('opossum');
const circuit = circuitBreaker().circuit;
const hystrixStats = circuit.hystrixStats;
module.exports = (app) => {
  Verification = async (req, res, next) => {
    res.writeHead(200, {'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive'});
    res.write('retry: 10000\n');
    res.write('event: connecttime\n');
  
    hystrixStats.getHystrixStream().pipe(res);
  }
}
@lance lance self-assigned this Dec 18, 2017
@lance lance added the ready label Dec 18, 2017
@lance
Copy link
Member

lance commented Dec 18, 2017

@DavideCarvalho I don't understand why you would do this. The circuit in this case is never firing, so there is no data to pipe through the stream. That said, I don't think it should throw a TypeError in this case.

@DavideCarvalho
Copy link
Author

In your example, you get the stream from only one circuit (at least i think it's from only one circuit, since you get the hystrixStatus from the circuit you just created), i'd like to know how aggregate all the stream so I can use on my url.

@lance
Copy link
Member

lance commented Dec 18, 2017

I will take a look, but I do not believe this is currently possible. Please feel free to submit a feature request for this, and I will look into it.

lance added a commit that referenced this issue Jan 30, 2018
If a user creates multiple circuits in the same process, they should aggregate
their stats in the Hystrix stream.

Fixes: #125
Ref: #124
@lance
Copy link
Member

lance commented Feb 19, 2018

@DavideCarvalho there is an open pull request for this here #140. If you have feedback on this it would be welcome.

lance added a commit that referenced this issue Mar 5, 2018
If a user creates multiple circuits in the same process, they should aggregate
their stats in the Hystrix stream.

Fixes: #125
Ref: #124
lance added a commit that referenced this issue Mar 18, 2018
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.
@lance
Copy link
Member

lance commented Mar 18, 2018

@DavideCarvalho can you confirm whether #140 addresses your concerns?

@lance
Copy link
Member

lance commented Mar 23, 2018

I'm going to go ahead and close this. If you find that your issue has not been resolved, feel free to reopen or to create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants