Documentation
¶
Index ¶
- Variables
- type UptimeTracker
- func (u *UptimeTracker) Connect(nodeID ids.NodeID) error
- func (u *UptimeTracker) Disconnect(nodeID ids.NodeID) error
- func (u *UptimeTracker) GetUptime(validationID ids.ID) (time.Duration, time.Time, error)
- func (u *UptimeTracker) Shutdown() error
- func (u *UptimeTracker) Sync(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrValidationIDNotFound = errors.New("validationID not found")
Functions ¶
This section is empty.
Types ¶
type UptimeTracker ¶
type UptimeTracker struct {
// contains filtered or unexported fields
}
UptimeTracker tracks uptime information for validators
func New ¶
func New( validatorState validators.State, subnetID ids.ID, db database.Database, clock *mockable.Clock, ) (*UptimeTracker, error)
New returns a new instance of UptimeTracker
func (*UptimeTracker) Connect ¶
func (u *UptimeTracker) Connect(nodeID ids.NodeID) error
Connect starts tracking a node. Nodes that are activated and connected will be treated as online.
func (*UptimeTracker) Disconnect ¶
func (u *UptimeTracker) Disconnect(nodeID ids.NodeID) error
Disconnect stops tracking a node. Disconnected nodes are treated as being offline.
func (*UptimeTracker) GetUptime ¶
GetUptime returns the uptime of the validator corresponding to validationID
func (*UptimeTracker) Shutdown ¶
func (u *UptimeTracker) Shutdown() error
Shutdown stops tracking uptimes and writes our state.
Click to show internal directories.
Click to hide internal directories.