Documentation ¶
Index ¶
- Constants
- type CheckFunc
- type Counter
- type Hystrix
- type StandHystrix
- func (h *StandHystrix) Do()
- func (h *StandHystrix) GetCounter() Counter
- func (h *StandHystrix) IsHystrix() bool
- func (h *StandHystrix) RegisterAliveCheck(check CheckFunc)
- func (h *StandHystrix) RegisterHystrixCheck(check CheckFunc)
- func (h *StandHystrix) SetCheckInterval(hystrixInterval, aliveInterval int)
- func (h *StandHystrix) SetMaxFailedNumber(number int64)
- func (h *StandHystrix) TriggerAlive()
- func (h *StandHystrix) TriggerHystrix()
- type StandardCounter
Constants ¶
View Source
const ( DefaultCheckHystrixInterval = 10 // unit is Second DefaultCheckAliveInterval = 60 // unit is Second DefaultCleanHistoryInterval = 60 * 5 // unit is Second DefaultMaxFailedNumber = 100 DefaultReserveMinutes = 30 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hystrix ¶
type Hystrix interface { // Do begin do check Do() // RegisterAliveCheck register check Alive func RegisterAliveCheck(CheckFunc) // RegisterHystrixCheck register check Hystrix func RegisterHystrixCheck(CheckFunc) // IsHystrix return is Hystrix status IsHystrix() bool // TriggerHystrix trigger Hystrix status TriggerHystrix() // TriggerAlive trigger Alive status TriggerAlive() // SetCheckInterval set interval for doCheckHystric and doCheckAlive, unit is Second SetCheckInterval(int, int) // GetCounter get lasted Counter with time key GetCounter() Counter // SetMaxFailed set max failed count for hystrix default counter SetMaxFailedNumber(int64) }
func NewHystrix ¶
NewHystrix create new Hystrix, config with CheckAliveFunc and checkAliveInterval, unit is Minute
type StandHystrix ¶
type StandHystrix struct {
// contains filtered or unexported fields
}
func (*StandHystrix) Do ¶
func (h *StandHystrix) Do()
func (*StandHystrix) GetCounter ¶
func (h *StandHystrix) GetCounter() Counter
GetCounter get lasted Counter with time key
func (*StandHystrix) IsHystrix ¶
func (h *StandHystrix) IsHystrix() bool
func (*StandHystrix) RegisterAliveCheck ¶
func (h *StandHystrix) RegisterAliveCheck(check CheckFunc)
func (*StandHystrix) RegisterHystrixCheck ¶
func (h *StandHystrix) RegisterHystrixCheck(check CheckFunc)
func (*StandHystrix) SetCheckInterval ¶
func (h *StandHystrix) SetCheckInterval(hystrixInterval, aliveInterval int)
func (*StandHystrix) SetMaxFailedNumber ¶
func (h *StandHystrix) SetMaxFailedNumber(number int64)
SetMaxFailed set max failed count for hystrix default counter
func (*StandHystrix) TriggerAlive ¶
func (h *StandHystrix) TriggerAlive()
func (*StandHystrix) TriggerHystrix ¶
func (h *StandHystrix) TriggerHystrix()
type StandardCounter ¶
type StandardCounter struct {
// contains filtered or unexported fields
}
StandardCounter is the standard implementation of a Counter
func (*StandardCounter) Count ¶
func (c *StandardCounter) Count() int64
Count returns the current count.
func (*StandardCounter) Dec ¶
func (c *StandardCounter) Dec(i int64)
Dec decrements the counter by the given amount.
func (*StandardCounter) Inc ¶
func (c *StandardCounter) Inc(i int64)
Inc increments the counter by the given amount.
Click to show internal directories.
Click to hide internal directories.