Documentation ¶
Overview ¶
Package uptime is a generated GoMock package.
Index ¶
- type Calculator
- type LockedCalculator
- type Manager
- type MockCalculator
- func (m *MockCalculator) CalculateUptime(arg0 ids.NodeID) (time.Duration, time.Time, error)
- func (m *MockCalculator) CalculateUptimePercent(arg0 ids.NodeID) (float64, error)
- func (m *MockCalculator) CalculateUptimePercentFrom(arg0 ids.NodeID, arg1 time.Time) (float64, error)
- func (m *MockCalculator) EXPECT() *MockCalculatorMockRecorder
- type MockCalculatorMockRecorder
- type State
- type TestManager
- type TestState
- func (s *TestState) AddNode(nodeID ids.NodeID, startTime time.Time)
- func (s *TestState) GetStartTime(nodeID ids.NodeID) (time.Time, error)
- func (s *TestState) GetUptime(nodeID ids.NodeID) (time.Duration, time.Time, error)
- func (s *TestState) SetUptime(nodeID ids.NodeID, upDuration time.Duration, lastUpdated time.Time) error
- type Tracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Calculator ¶
type Calculator interface { CalculateUptime(nodeID ids.NodeID) (time.Duration, time.Time, error) CalculateUptimePercent(nodeID ids.NodeID) (float64, error) // CalculateUptimePercentFrom expects [startTime] to be truncated (floored) to the nearest second CalculateUptimePercentFrom(nodeID ids.NodeID, startTime time.Time) (float64, error) }
type LockedCalculator ¶
type LockedCalculator interface { Calculator SetCalculator(isBootstrapped *utils.AtomicBool, lock sync.Locker, newC Calculator) }
func NewLockedCalculator ¶
func NewLockedCalculator() LockedCalculator
type MockCalculator ¶ added in v1.9.1
type MockCalculator struct {
// contains filtered or unexported fields
}
MockCalculator is a mock of Calculator interface.
func NewMockCalculator ¶ added in v1.9.1
func NewMockCalculator(ctrl *gomock.Controller) *MockCalculator
NewMockCalculator creates a new mock instance.
func (*MockCalculator) CalculateUptime ¶ added in v1.9.1
CalculateUptime mocks base method.
func (*MockCalculator) CalculateUptimePercent ¶ added in v1.9.1
func (m *MockCalculator) CalculateUptimePercent(arg0 ids.NodeID) (float64, error)
CalculateUptimePercent mocks base method.
func (*MockCalculator) CalculateUptimePercentFrom ¶ added in v1.9.1
func (m *MockCalculator) CalculateUptimePercentFrom(arg0 ids.NodeID, arg1 time.Time) (float64, error)
CalculateUptimePercentFrom mocks base method.
func (*MockCalculator) EXPECT ¶ added in v1.9.1
func (m *MockCalculator) EXPECT() *MockCalculatorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockCalculatorMockRecorder ¶ added in v1.9.1
type MockCalculatorMockRecorder struct {
// contains filtered or unexported fields
}
MockCalculatorMockRecorder is the mock recorder for MockCalculator.
func (*MockCalculatorMockRecorder) CalculateUptime ¶ added in v1.9.1
func (mr *MockCalculatorMockRecorder) CalculateUptime(arg0 interface{}) *gomock.Call
CalculateUptime indicates an expected call of CalculateUptime.
func (*MockCalculatorMockRecorder) CalculateUptimePercent ¶ added in v1.9.1
func (mr *MockCalculatorMockRecorder) CalculateUptimePercent(arg0 interface{}) *gomock.Call
CalculateUptimePercent indicates an expected call of CalculateUptimePercent.
func (*MockCalculatorMockRecorder) CalculateUptimePercentFrom ¶ added in v1.9.1
func (mr *MockCalculatorMockRecorder) CalculateUptimePercentFrom(arg0, arg1 interface{}) *gomock.Call
CalculateUptimePercentFrom indicates an expected call of CalculateUptimePercentFrom.
type State ¶
type State interface { // GetUptime returns [upDuration] and [lastUpdated] to be truncated (floored) to the nearest second GetUptime(nodeID ids.NodeID) (upDuration time.Duration, lastUpdated time.Time, err error) // SetUptime expects [upDuration] and [lastUpdated] to be truncated (floored) to the nearest second SetUptime(nodeID ids.NodeID, upDuration time.Duration, lastUpdated time.Time) error // GetStartTime returns [startTime] truncated (floored) to the nearest second GetStartTime(nodeID ids.NodeID) (startTime time.Time, err error) }
type TestManager ¶
type TestState ¶
type TestState struct {
// contains filtered or unexported fields
}
func NewTestState ¶
func NewTestState() *TestState