Documentation ¶
Overview ¶
Package tracker is a generated GoMock package.
Package tracker is a generated GoMock package.
Index ¶
- type DiskTracker
- type MockResourceTracker
- func (m *MockResourceTracker) CPUTracker() Tracker
- func (m *MockResourceTracker) DiskTracker() Tracker
- func (m *MockResourceTracker) EXPECT() *MockResourceTrackerMockRecorder
- func (m *MockResourceTracker) StartProcessing(arg0 ids.NodeID, arg1 time.Time)
- func (m *MockResourceTracker) StopProcessing(arg0 ids.NodeID, arg1 time.Time)
- type MockResourceTrackerMockRecorder
- func (mr *MockResourceTrackerMockRecorder) CPUTracker() *gomock.Call
- func (mr *MockResourceTrackerMockRecorder) DiskTracker() *gomock.Call
- func (mr *MockResourceTrackerMockRecorder) StartProcessing(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockResourceTrackerMockRecorder) StopProcessing(arg0, arg1 interface{}) *gomock.Call
- type MockTargeter
- type MockTargeterMockRecorder
- type MockTracker
- type MockTrackerMockRecorder
- type ResourceTracker
- type Targeter
- type TargeterConfig
- type Tracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiskTracker ¶ added in v1.8.4
type MockResourceTracker ¶ added in v1.8.4
type MockResourceTracker struct {
// contains filtered or unexported fields
}
MockResourceTracker is a mock of ResourceTracker interface.
func NewMockResourceTracker ¶ added in v1.8.4
func NewMockResourceTracker(ctrl *gomock.Controller) *MockResourceTracker
NewMockResourceTracker creates a new mock instance.
func (*MockResourceTracker) CPUTracker ¶ added in v1.8.4
func (m *MockResourceTracker) CPUTracker() Tracker
CPUTracker mocks base method.
func (*MockResourceTracker) DiskTracker ¶ added in v1.8.4
func (m *MockResourceTracker) DiskTracker() Tracker
DiskTracker mocks base method.
func (*MockResourceTracker) EXPECT ¶ added in v1.8.4
func (m *MockResourceTracker) EXPECT() *MockResourceTrackerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockResourceTracker) StartProcessing ¶ added in v1.8.4
func (m *MockResourceTracker) StartProcessing(arg0 ids.NodeID, arg1 time.Time)
StartProcessing mocks base method.
func (*MockResourceTracker) StopProcessing ¶ added in v1.8.4
func (m *MockResourceTracker) StopProcessing(arg0 ids.NodeID, arg1 time.Time)
StopProcessing mocks base method.
type MockResourceTrackerMockRecorder ¶ added in v1.8.4
type MockResourceTrackerMockRecorder struct {
// contains filtered or unexported fields
}
MockResourceTrackerMockRecorder is the mock recorder for MockResourceTracker.
func (*MockResourceTrackerMockRecorder) CPUTracker ¶ added in v1.8.4
func (mr *MockResourceTrackerMockRecorder) CPUTracker() *gomock.Call
CPUTracker indicates an expected call of CPUTracker.
func (*MockResourceTrackerMockRecorder) DiskTracker ¶ added in v1.8.4
func (mr *MockResourceTrackerMockRecorder) DiskTracker() *gomock.Call
DiskTracker indicates an expected call of DiskTracker.
func (*MockResourceTrackerMockRecorder) StartProcessing ¶ added in v1.8.4
func (mr *MockResourceTrackerMockRecorder) StartProcessing(arg0, arg1 interface{}) *gomock.Call
StartProcessing indicates an expected call of StartProcessing.
func (*MockResourceTrackerMockRecorder) StopProcessing ¶ added in v1.8.4
func (mr *MockResourceTrackerMockRecorder) StopProcessing(arg0, arg1 interface{}) *gomock.Call
StopProcessing indicates an expected call of StopProcessing.
type MockTargeter ¶ added in v1.8.4
type MockTargeter struct {
// contains filtered or unexported fields
}
MockTargeter is a mock of Targeter interface.
func NewMockTargeter ¶ added in v1.8.4
func NewMockTargeter(ctrl *gomock.Controller) *MockTargeter
NewMockTargeter creates a new mock instance.
func (*MockTargeter) EXPECT ¶ added in v1.8.4
func (m *MockTargeter) EXPECT() *MockTargeterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTargeter) TargetUsage ¶ added in v1.8.4
func (m *MockTargeter) TargetUsage(nodeID ids.NodeID) float64
TargetUsage mocks base method.
type MockTargeterMockRecorder ¶ added in v1.8.4
type MockTargeterMockRecorder struct {
// contains filtered or unexported fields
}
MockTargeterMockRecorder is the mock recorder for MockTargeter.
func (*MockTargeterMockRecorder) TargetUsage ¶ added in v1.8.4
func (mr *MockTargeterMockRecorder) TargetUsage(nodeID interface{}) *gomock.Call
TargetUsage indicates an expected call of TargetUsage.
type MockTracker ¶ added in v1.8.4
type MockTracker struct {
// contains filtered or unexported fields
}
MockTracker is a mock of Tracker interface.
func NewMockTracker ¶ added in v1.8.4
func NewMockTracker(ctrl *gomock.Controller) *MockTracker
NewMockTracker creates a new mock instance.
func (*MockTracker) EXPECT ¶ added in v1.8.4
func (m *MockTracker) EXPECT() *MockTrackerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTracker) TimeUntilUsage ¶ added in v1.8.4
TimeUntilUsage mocks base method.
func (*MockTracker) TotalUsage ¶ added in v1.8.4
func (m *MockTracker) TotalUsage() float64
TotalUsage mocks base method.
type MockTrackerMockRecorder ¶ added in v1.8.4
type MockTrackerMockRecorder struct {
// contains filtered or unexported fields
}
MockTrackerMockRecorder is the mock recorder for MockTracker.
func (*MockTrackerMockRecorder) TimeUntilUsage ¶ added in v1.8.4
func (mr *MockTrackerMockRecorder) TimeUntilUsage(nodeID, now, value interface{}) *gomock.Call
TimeUntilUsage indicates an expected call of TimeUntilUsage.
func (*MockTrackerMockRecorder) TotalUsage ¶ added in v1.8.4
func (mr *MockTrackerMockRecorder) TotalUsage() *gomock.Call
TotalUsage indicates an expected call of TotalUsage.
func (*MockTrackerMockRecorder) Usage ¶ added in v1.8.4
func (mr *MockTrackerMockRecorder) Usage(nodeID, now interface{}) *gomock.Call
Usage indicates an expected call of Usage.
type ResourceTracker ¶ added in v1.8.4
type ResourceTracker interface { CPUTracker() Tracker DiskTracker() DiskTracker // Registers that the given node started processing at the given time. StartProcessing(ids.NodeID, time.Time) // Registers that the given node stopped processing at the given time. StopProcessing(ids.NodeID, time.Time) }
ResourceTracker is an interface for tracking peers' usage of resources
func NewResourceTracker ¶ added in v1.8.4
func NewResourceTracker( reg prometheus.Registerer, resources resource.User, factory meter.Factory, halflife time.Duration, ) (ResourceTracker, error)
type Targeter ¶ added in v1.8.4
type Targeter interface { // Returns the target usage of the given node. TargetUsage(nodeID ids.NodeID) float64 }
func NewTargeter ¶ added in v1.8.4
func NewTargeter( config *TargeterConfig, vdrs validators.Set, tracker Tracker, ) Targeter
type TargeterConfig ¶ added in v1.8.4
type TargeterConfig struct { // VdrAlloc is the amount of the resource to split over validators, weighted // by stake. VdrAlloc float64 `json:"vdrAlloc"` // MaxNonVdrUsage is the amount of the resource which, if utilized, will // result in allocations being based only on the stake weighted allocation. MaxNonVdrUsage float64 `json:"maxNonVdrUsage"` // MaxNonVdrNodeUsage is the amount of the resource to allocate to a node // before adding the stake weighted allocation. MaxNonVdrNodeUsage float64 `json:"maxNonVdrNodeUsage"` }
type Tracker ¶ added in v1.8.4
type Tracker interface { // Returns the current usage for the given node. Usage(nodeID ids.NodeID, now time.Time) float64 // Returns the current usage by all nodes. TotalUsage() float64 // Returns the duration between [now] and when the usage of [nodeID] reaches // [value], assuming that the node uses no more resources. // If the node's usage isn't known, or is already <= [value], returns the // zero duration. TimeUntilUsage(nodeID ids.NodeID, now time.Time, value float64) time.Duration }