tracker

package
v1.7.11-rc.6 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: BSD-3-Clause Imports: 12 Imported by: 30

Documentation

Overview

Package tracker is a generated GoMock package.

Package mock_tracker is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUTargeter

type CPUTargeter interface {
	// Return the target CPU usage of the given node.
	TargetCPUUsage(nodeID ids.NodeID) float64
}

func NewCPUTargeter

func NewCPUTargeter(reg prometheus.Registerer, config *CPUTargeterConfig, vdrs validators.Set, cpuTracker TimeTracker) (targeter CPUTargeter, err error)

type CPUTargeterConfig

type CPUTargeterConfig struct {
	CPUTarget                    float64 `json:"cpuTarget"`
	VdrCPUPercentage             float64 `json:"vdrCPUPercentage"`
	SinglePeerMaxUsagePercentage float64 `json:"singlePeerMaxUsagePercentage"`
	MaxScaling                   float64 `json:"maxScaling"`
}

type MockCPUTargeter

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

MockCPUTargeter is a mock of CPUTargeter interface

func NewMockCPUTargeter

func NewMockCPUTargeter(ctrl *gomock.Controller) *MockCPUTargeter

NewMockCPUTargeter creates a new mock instance

func (*MockCPUTargeter) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockCPUTargeter) TargetCPUUsage

func (m *MockCPUTargeter) TargetCPUUsage(arg0 ids.NodeID) float64

TargetCPUUsage mocks base method

type MockCPUTargeterMockRecorder

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

MockCPUTargeterMockRecorder is the mock recorder for MockCPUTargeter

func (*MockCPUTargeterMockRecorder) TargetCPUUsage

func (mr *MockCPUTargeterMockRecorder) TargetCPUUsage(arg0 interface{}) *gomock.Call

TargetCPUUsage indicates an expected call of TargetCPUUsage

type MockTimeTracker added in v1.4.10

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

MockTimeTracker is a mock of TimeTracker interface

func NewMockTimeTracker

func NewMockTimeTracker(ctrl *gomock.Controller) *MockTimeTracker

NewMockTimeTracker creates a new mock instance

func (*MockTimeTracker) ActiveWeight

func (m *MockTimeTracker) ActiveWeight() uint64

ActiveWeight mocks base method

func (*MockTimeTracker) CumulativeUtilization added in v1.4.10

func (m *MockTimeTracker) CumulativeUtilization(arg0 time.Time) float64

CumulativeUtilization mocks base method

func (*MockTimeTracker) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockTimeTracker) Len added in v1.4.10

func (m *MockTimeTracker) Len() int

Len mocks base method

func (*MockTimeTracker) StartCPU added in v1.7.5

func (m *MockTimeTracker) StartCPU(arg0 ids.NodeID, arg1 time.Time)

StartCPU mocks base method

func (*MockTimeTracker) StopCPU added in v1.7.5

func (m *MockTimeTracker) StopCPU(arg0 ids.NodeID, arg1 time.Time)

StopCPU mocks base method

func (*MockTimeTracker) TimeUntilUtilization

func (m *MockTimeTracker) TimeUntilUtilization(arg0 ids.NodeID, arg1 time.Time, arg2 float64) time.Duration

TimeUntilUtilization mocks base method

func (*MockTimeTracker) Utilization added in v1.4.10

func (m *MockTimeTracker) Utilization(arg0 ids.NodeID, arg1 time.Time) float64

Utilization mocks base method

type MockTimeTrackerMockRecorder

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

MockTimeTrackerMockRecorder is the mock recorder for MockTimeTracker

func (*MockTimeTrackerMockRecorder) ActiveWeight

func (mr *MockTimeTrackerMockRecorder) ActiveWeight() *gomock.Call

ActiveWeight indicates an expected call of ActiveWeight

func (*MockTimeTrackerMockRecorder) CumulativeUtilization

func (mr *MockTimeTrackerMockRecorder) CumulativeUtilization(arg0 interface{}) *gomock.Call

CumulativeUtilization indicates an expected call of CumulativeUtilization

func (*MockTimeTrackerMockRecorder) Len

Len indicates an expected call of Len

func (*MockTimeTrackerMockRecorder) StartCPU

func (mr *MockTimeTrackerMockRecorder) StartCPU(arg0, arg1 interface{}) *gomock.Call

StartCPU indicates an expected call of StartCPU

func (*MockTimeTrackerMockRecorder) StopCPU

func (mr *MockTimeTrackerMockRecorder) StopCPU(arg0, arg1 interface{}) *gomock.Call

StopCPU indicates an expected call of StopCPU

func (*MockTimeTrackerMockRecorder) TimeUntilUtilization

func (mr *MockTimeTrackerMockRecorder) TimeUntilUtilization(arg0, arg1, arg2 interface{}) *gomock.Call

TimeUntilUtilization indicates an expected call of TimeUntilUtilization

func (*MockTimeTrackerMockRecorder) Utilization

func (mr *MockTimeTrackerMockRecorder) Utilization(arg0, arg1 interface{}) *gomock.Call

Utilization indicates an expected call of Utilization

type TimeTracker

type TimeTracker interface {
	// Registers that the given node started using a CPU
	// core at the given time.
	StartCPU(ids.NodeID, time.Time)
	// Registers that the given node stopped using a CPU
	// core at the given time.
	StopCPU(ids.NodeID, time.Time)
	// Returns the current EWMA of CPU utilization for the given node.
	Utilization(ids.NodeID, time.Time) float64
	// Returns the current EWMA of CPU utilization for all nodes.
	CumulativeUtilization(time.Time) float64
	// Returns the duration between [now] and when the CPU utilization of
	// [nodeID] reaches [value], assuming that the node uses no more CPU.
	// If the node's CPU utilization isn't known, or is already <= [value],
	// returns the zero duration.
	TimeUntilUtilization(nodeID ids.NodeID, now time.Time, value float64) time.Duration
	// Returns the number of nodes that have recently used CPU time.
	Len() int
	// Returns the total weight of CPU spenders that have recently used CPU.
	ActiveWeight() uint64
}

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

func NewCPUTracker

func NewCPUTracker(reg prometheus.Registerer, factory uptime.Factory, halflife time.Duration, vdrs validators.Set) (TimeTracker, error)

Jump to

Keyboard shortcuts

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