v3go.etcd.io/etcd/pkg/v3/contention Index | Files

package contention

import "go.etcd.io/etcd/pkg/v3/contention"

Package contention provides facilities for detecting system contention.

Index

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(which uint64) (bool, time.Duration)

Observe observes an event for given id. It returns false and exceeded duration if the interval is longer than the expectation.

func (*TimeoutDetector) Reset

func (td *TimeoutDetector) Reset()

Reset resets the NewTimeoutDetector.

Source Files

contention.go doc.go

Version
v3.5.18 (latest)
Published
Jan 24, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
6 days ago

Tools for package owners.