You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a need to check if a circuit is open. Is there an easy way to do that? Also, we want to send some status to our metrics server and the only way I can think of is to hack the HTTP streamer. An example here (to stdout):
// This is used to output the Hystrix stream to stdout and only used for debugging// circuit statstypeoutputResponseStdoutstruct {
HeaderMap http.Header
}
func (o*outputResponseStdout) Header() http.Header {
m:=o.HeaderMapifm==nil {
m=make(http.Header)
o.HeaderMap=m
}
returnm
}
func (o*outputResponseStdout) Write(buf []byte) (int, error) {
returnos.Stdout.Write(buf)
}
func (o*outputResponseStdout) WriteHeader(cint) {
fmt.Println("HTTP code: ", c)
}
funcOutputHystrixEvents() {
s:=hystrix.NewStreamHandler()
s.Start()
rh:=&outputResponseStdout{}
req, err:=http.NewRequest("GET", "", nil)
iferr!=nil {
return
}
s.ServeHTTP(rh, req)
}
The text was updated successfully, but these errors were encountered:
We have a need to check if a circuit is open. Is there an easy way to do that? Also, we want to send some status to our metrics server and the only way I can think of is to hack the HTTP streamer. An example here (to stdout):
The text was updated successfully, but these errors were encountered: