etcd: Index | Files

package contention

import ""

Package contention provides facilities for detecting system contention.


Package Files

contention.go doc.go

type TimeoutDetector Uses

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 Uses

func NewTimeoutDetector(maxDuration time.Duration) *TimeoutDetector

NewTimeoutDetector creates the TimeoutDetector.

func (*TimeoutDetector) Observe Uses

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 Uses

func (td *TimeoutDetector) Reset()

Reset resets the NewTimeoutDetector.

Package contention imports 2 packages (graph) and is imported by 27 packages. Updated 2018-08-29. Refresh now. Tools for package owners.