uptime

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// Should only be called once
	StartTracking(nodeIDs []ids.ShortID) error

	// Should only be called once
	Shutdown(nodeIDs []ids.ShortID) error

	Connect(nodeID ids.ShortID) error
	IsConnected(nodeID ids.ShortID) bool
	Disconnect(nodeID ids.ShortID) error

	CalculateUptime(nodeID ids.ShortID) (time.Duration, time.Time, error)
	CalculateUptimePercent(nodeID ids.ShortID, startTime time.Time) (float64, error)
}

func NewManager

func NewManager(state State) Manager

type State

type State interface {
	GetUptime(nodeID ids.ShortID) (upDuration time.Duration, lastUpdated time.Time, err error)
	SetUptime(nodeID ids.ShortID, upDuration time.Duration, lastUpdated time.Time) error
}

type TestManager

type TestManager interface {
	Manager
	SetTime(time.Time)
}

Jump to

Keyboard shortcuts

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