contention

package
v3.6.10 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Overview

Package contention provides facilities for detecting system contention.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeoutDetector

type TimeoutDetector struct {
	// contains filtered or unexported fields
}

TimeoutDetector detects routine starvations by observing the actual time duration to finish an action or between two events that should happen in a fixed interval. If the observed duration is longer than the expectation, the detector will report the result.

func NewTimeoutDetector

func NewTimeoutDetector(maxDuration time.Duration) *TimeoutDetector

NewTimeoutDetector creates the TimeoutDetector.

func (*TimeoutDetector) Observe

func (td *TimeoutDetector) Observe(id uint64) (bool, time.Duration)

Observe observes an event of given id. It computes the time elapsed between successive events of given id. It returns whether this time elapsed exceeds the expectation, and the amount by which it exceeds the expectation.

func (*TimeoutDetector) Reset

func (td *TimeoutDetector) Reset()

Reset resets the TimeoutDetector.

Jump to

Keyboard shortcuts

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