Documentation ¶
Overview ¶
Package tracker is a generated GoMock package.
Package mock_tracker is a generated GoMock package.
Index ¶
- type CPUTargeter
- type CPUTargeterConfig
- type MockCPUTargeter
- type MockCPUTargeterMockRecorder
- type MockTimeTracker
- func (m *MockTimeTracker) ActiveWeight() uint64
- func (m *MockTimeTracker) CumulativeUtilization(arg0 time.Time) float64
- func (m *MockTimeTracker) EXPECT() *MockTimeTrackerMockRecorder
- func (m *MockTimeTracker) Len() int
- func (m *MockTimeTracker) StartCPU(arg0 ids.NodeID, arg1 time.Time)
- func (m *MockTimeTracker) StopCPU(arg0 ids.NodeID, arg1 time.Time)
- func (m *MockTimeTracker) TimeUntilUtilization(arg0 ids.NodeID, arg1 time.Time, arg2 float64) time.Duration
- func (m *MockTimeTracker) Utilization(arg0 ids.NodeID, arg1 time.Time) float64
- type MockTimeTrackerMockRecorder
- func (mr *MockTimeTrackerMockRecorder) ActiveWeight() *gomock.Call
- func (mr *MockTimeTrackerMockRecorder) CumulativeUtilization(arg0 interface{}) *gomock.Call
- func (mr *MockTimeTrackerMockRecorder) Len() *gomock.Call
- func (mr *MockTimeTrackerMockRecorder) StartCPU(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockTimeTrackerMockRecorder) StopCPU(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockTimeTrackerMockRecorder) TimeUntilUtilization(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockTimeTrackerMockRecorder) Utilization(arg0, arg1 interface{}) *gomock.Call
- type TimeTracker
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 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 ¶
func (m *MockCPUTargeter) EXPECT() *MockCPUTargeterMockRecorder
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 ¶
func (m *MockTimeTracker) EXPECT() *MockTimeTrackerMockRecorder
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
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 ¶
func (mr *MockTimeTrackerMockRecorder) Len() *gomock.Call
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)