Documentation ¶
Overview ¶
Package autopostpone provides utilities to decide whether to postpone write.
Index ¶
- type PostponeWrite
- func (f *PostponeWrite) CheckAndDisablePostponeWrite(packetsNum int)
- func (f *PostponeWrite) CheckLoopCnt()
- func (f *PostponeWrite) Enabled() bool
- func (f *PostponeWrite) IncLoopCnt()
- func (f *PostponeWrite) IncReadingTryLockFail()
- func (f *PostponeWrite) ResetLoopCnt()
- func (f *PostponeWrite) ResetReadingTryLockFail()
- func (f *PostponeWrite) Set(postponeWrite bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostponeWrite ¶
type PostponeWrite struct {
// contains filtered or unexported fields
}
PostponeWrite is the struct for postpone write.
func (*PostponeWrite) CheckAndDisablePostponeWrite ¶
func (f *PostponeWrite) CheckAndDisablePostponeWrite(packetsNum int)
CheckAndDisablePostponeWrite changes postpone write to false if max consecutive same packets number is reached.
func (*PostponeWrite) CheckLoopCnt ¶
func (f *PostponeWrite) CheckLoopCnt()
CheckLoopCnt changes postpone write to true if user handler is processed more than a certain threshold.
func (*PostponeWrite) Enabled ¶
func (f *PostponeWrite) Enabled() bool
Enabled returns whether postpone write is enabled.
func (*PostponeWrite) IncLoopCnt ¶
func (f *PostponeWrite) IncLoopCnt()
IncLoopCnt increments loop count.
func (*PostponeWrite) IncReadingTryLockFail ¶
func (f *PostponeWrite) IncReadingTryLockFail()
IncReadingTryLockFail increases reading try lock failed counts and changes postpone write to true if high reading lock contention is observed.
func (*PostponeWrite) ResetLoopCnt ¶
func (f *PostponeWrite) ResetLoopCnt()
ResetLoopCnt resets loop count to 0.
func (*PostponeWrite) ResetReadingTryLockFail ¶
func (f *PostponeWrite) ResetReadingTryLockFail()
ResetReadingTryLockFail resets reading try lock failed counts.
func (*PostponeWrite) Set ¶
func (f *PostponeWrite) Set(postponeWrite bool)
Set sets the postpone write value manually.