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

Improve documentation for hystrix client options #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions hystrix/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ func WithCommandName(name string) Option {
}
}

// WithHTTPTimeout sets hystrix timeout
// WithHTTPTimeout sets hystrix timeout in milliseconds
func WithHTTPTimeout(timeout time.Duration) Option {
return func(c *Client) {
c.timeout = timeout
}
}

// WithHystrixTimeout sets hystrix timeout
// WithHystrixTimeout sets hystrix timeout in milliseconds
func WithHystrixTimeout(timeout time.Duration) Option {
return func(c *Client) {
c.hystrixTimeout = timeout
Expand All @@ -39,21 +39,24 @@ func WithMaxConcurrentRequests(maxConcurrentRequests int) Option {
}
}

// WithRequestVolumeThreshold sets hystrix request volume threshold
// WithRequestVolumeThreshold sets hystrix request volume threshold,
// the minimum number of requests needed before a circuit can be tripped due to health
func WithRequestVolumeThreshold(requestVolumeThreshold int) Option {
return func(c *Client) {
c.requestVolumeThreshold = requestVolumeThreshold
}
}

// WithSleepWindow sets hystrix sleep window
// WithSleepWindow sets hystrix sleep window in milliseconds,
// to wait after a circuit opens before testing for recovery
func WithSleepWindow(sleepWindow int) Option {
return func(c *Client) {
c.sleepWindow = sleepWindow
}
}

// WithErrorPercentThreshold sets hystrix error percent threshold
// WithErrorPercentThreshold sets hystrix error percent threshold,
// causes circuits to open once the rolling measure of errors exceeds this percent of requests
func WithErrorPercentThreshold(errorPercentThreshold int) Option {
return func(c *Client) {
c.errorPercentThreshold = errorPercentThreshold
Expand Down