Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultTimeout is how long to wait for command to complete, in milliseconds DefaultTimeout = 1000 // DefaultMaxConcurrent is how many commands can run at the same time in an executor pool DefaultMaxConcurrent = 10 // DefaultVolumeThreshold is the minimum number of requests needed before a circuit can be tripped due to health DefaultVolumeThreshold = 20 // DefaultSleepWindow is how long, in milliseconds, to wait after a circuit opens before testing for recovery DefaultSleepWindow = 5000 // DefaultErrorPercentThreshold causes circuits to open once the rolling measure of errors exceeds this percent of requests DefaultErrorPercentThreshold = 50 )
Functions ¶
func Configure ¶
func Configure(cmds map[string]CommandConfig)
Configure applies settings for a set of circuits
func ConfigureCommand ¶
func ConfigureCommand(name string, config CommandConfig)
ConfigureCommand applies settings for a circuit
func GetCircuitConfigMap ¶
Types ¶
type CommandConfig ¶
type CommandConfig struct {
Timeout int `json:"timeout"`
MaxConcurrentRequests int `json:"max_concurrent_requests"`
RequestVolumeThreshold int `json:"request_volume_threshold"`
SleepWindow int `json:"sleep_window"`
ErrorPercentThreshold int `json:"error_percent_threshold"`
}
CommandConfig is used to tune circuit settings at runtime
Click to show internal directories.
Click to hide internal directories.