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 ...
Click to show internal directories.
Click to hide internal directories.