autopostpone

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 3 Imported by: 0

Documentation

Overview

Package autopostpone provides utilities to decide whether to postpone write.

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL