tracker

package
Version: v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountingTracker

type CountingTracker interface {
	Add(ids.ShortID)                               // increments total count taken by ID
	AddPool(ids.ShortID)                           // increments pool messages taken by ID
	Remove(ids.ShortID)                            // removes a message taken by ID
	OutstandingCount(ids.ShortID) (uint32, uint32) // returns the total count and pool count
	PoolCount() uint32                             // returns the total count of messages taken from the pool
}

CountingTracker is an interface for tracking peers' usage of a discrete resource

func NewMessageTracker

func NewMessageTracker() CountingTracker

NewMessageTracker returns a CountingTracker to track pending messages from peers

type TimeTracker

type TimeTracker interface {
	UtilizeTime(ids.ShortID, time.Time, time.Time)
	Utilization(ids.ShortID, time.Time) float64
	CumulativeUtilization(time.Time) float64
	Len() int
	EndInterval(time.Time)
}

TimeTracker is an interface for tracking peers' usage of CPU Time

func NewCPUTracker

func NewCPUTracker(factory uptime.Factory, halflife time.Duration) TimeTracker

NewCPUTracker ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL