Documentation ¶
Overview ¶
Package hystrix
Package hystrix
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBreaker ¶
func NewBreaker(name string, opts ...Option) circuitbreaker.Breaker
Types ¶
type Option ¶
type Option func(breaker *breaker)
func WithErrorPercentThreshold ¶
WithErrorPercentThreshold 错误百分比,默认值是50(当错误百分比超过这个限制时则进行熔断)。请求数量大于等于RequestVolumeThreshold并且错误率到达这个百分比后就会启动熔断
func WithMaxConcurrentRequests ¶
WithMaxConcurrentRequests 最大并发量,默认值是10
func WithRequestVolumeThreshold ¶
WithRequestVolumeThreshold 一个统计窗口10秒内请求数量。达到这个请求数量后才去判断是否要开启熔断,默认值是20(比如10秒内接到了11个请求只超过了1个)
func WithSleepWindow ¶
WithSleepWindow 熔断后多久去尝试服务是否可用,默认值是5000毫秒(熔断器打开到半打开的时间),milliseconds
func WithTimeout ¶
WithTimeout 单次请求超时时间,默认时间是1000毫秒,milliseconds
Click to show internal directories.
Click to hide internal directories.