dahernan / gohystrix Goto Github PK
View Code? Open in Web Editor NEWLike Nexflix Hystrix but in Go
License: Other
Like Nexflix Hystrix but in Go
License: Other
Just for discussion: I find it "ugly" to have to define a Name()
and Group()
function.
I played around with a few concepts, and I came up with the following solution:
The command only has one Describe()
function, which returns a goHystrix.CommandOptions
containing all necessary values (name, group, threadgroup, isolation level, etc.). Using the builder pattern, this function could be very small, but descriptive.
An example, how this could look like can be seen at this gist: https://gist.github.com/ZeissS/9766129
What do you think?
Hi,
I can only find ErrorPercetageThreshold on the README.md and nothing on the code itself, only ErrorsThreshold.
I'm thinking of moving the methods Timeout(), Name(), and Group() to CommandOptions and keep the Interface simple.
You can pass the options to the NewCommand as following
NewCommand(interface, commandOptions, circuitOptions)
@zeisss any advice??
In the NetFlix Hystrix Java implementation an open circuit breaker will reset itself (i.e., close) after circuitBreaker.sleepWindowInMilliseconds
. In goHystrix an open circuit breaker will only reset itself if no requests are received during the NumberOfSecondsToStore
interval. The NumberOfSecondsToStore
interval is important in defining the rolling window of metrics but it's not enough. A circuit breaker implementation also needs to provide a way for the breaker to periodically allow requests to go through in order to see if the failed dependency has resolved, i.e., it needs to support a 3rd state - half-open.
Do you have any plans to provide a half-open state similar to NetFlix's Hystrix? If not, would you accept a pull request to implement it?
I do like goHystrix's support for access to detailed metrics!
Put a cancellation channel or context like this http://blog.golang.org/context, so you can is some way to send a cancellacion signal to go routines
cancel the go routine when a timeout is reached
Given I have an application which uses goHystric to secure it backend calls, I would like to expose the collected statistics to an external service automatically, e.g. statsd/graphite.
Currently, Circuits()
already provides me with an way to access existing CircuitBreakers, if I have the names. With this I can access the metrics and thus via Stats()
the samples values.
It would be nicer to have some operation to iterate over all existing circuitbreakers, to automatically expose them. This could as simple as having an Each(handler func(group, name string, breaker *CircuitBreaker)
function, which loops over everything.
Currently Executor#Execute()
only calls Run()
OR Fallback()
depending on the CircuitBreaker
. The original Hystrix implementation also calls the fallback in case of a timeout or exception in Run()
as well.
See the flowchart at https://github.com/Netflix/Hystrix/wiki/How-it-Works#Flow
Hi,
I just stumbled upon the original netflix article and was searching, whether someone did something similar for Go. And there you are :) Thanks!
I was wondering, why you made the Fallback() function required? I think one could just define an aditional interface, move the fallback function there and check (on error in Run()), if the command can be converted to the Fallback interface.
Just a thought I had while reading your README (I haven't actually tried anything yet).
Thanks again!
P.S.: The same could be done for the Timeout. Just default to something like 5 seconds.
Add a way to define a command with a function (like http.HandleFunc works :)
Can you add a LICENSE? :)
With the JSON of all the circuits is possible to render a dashboard similar to https://raw.github.com/wiki/Netflix/Hystrix/images/hystrix-dashboard-single-row.png
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.