statistics

package
v1.3.21 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRoundDuration = errors.New("invalid round duration")

ErrInvalidRoundDuration signals that an invalid round duration was provided

View Source
var ErrInvalidShardId = errors.New("invalid shard id")

ErrInvalidShardId signals that the shard id is invalid

View Source
var ErrNilConfig = errors.New("nil config")

ErrNilConfig signals that a nil config was provided

View Source
var ErrNilInitialTPSBenchmarks = errors.New("nil initial TPS benchmarks")

ErrNilInitialTPSBenchmarks signals that nil TPS benchmarks have been provided

View Source
var ErrNilPathHandler = errors.New("nil path handler")

ErrNilPathHandler signals that a nil path handler was provided

View Source
var ErrNilStatusHandler = errors.New("nil status handler")

ErrNilStatusHandler signals that a nil status handler has been provided

Functions

func GetRuntimeStatistics

func GetRuntimeStatistics() []interface{}

GetRuntimeStatistics will return the statistics regarding the current time, memory consumption and the number of running go routines These return statistics can be easily output in a log line

Types

type ResourceMonitor

type ResourceMonitor struct {
	// contains filtered or unexported fields
}

ResourceMonitor outputs statistics about resources used by the binary

func NewResourceMonitor

func NewResourceMonitor(config *config.Config, pathManager storage.PathManagerHandler, shardId string) (*ResourceMonitor, error)

NewResourceMonitor creates a new ResourceMonitor instance

func (*ResourceMonitor) Close

func (rm *ResourceMonitor) Close() error

Close closes all underlying components

func (*ResourceMonitor) GenerateStatistics

func (rm *ResourceMonitor) GenerateStatistics() []interface{}

GenerateStatistics creates a new statistic string

func (*ResourceMonitor) IsInterfaceNil

func (rm *ResourceMonitor) IsInterfaceNil() bool

IsInterfaceNil returns true if underlying object is nil

func (*ResourceMonitor) SaveStatistics

func (rm *ResourceMonitor) SaveStatistics()

SaveStatistics generates and saves statistic data on the disk

func (*ResourceMonitor) StartMonitoring

func (rm *ResourceMonitor) StartMonitoring()

StartMonitoring starts the monitoring process for saving statistics

type ResourceMonitorHandler

type ResourceMonitorHandler interface {
	GenerateStatistics() []interface{}
	SaveStatistics()
	StartMonitoring()
	Close() error
	IsInterfaceNil() bool
}

ResourceMonitorHandler defines the resource monitor supported actions

type SoftwareVersionChecker

type SoftwareVersionChecker interface {
	StartCheckSoftwareVersion()
	IsInterfaceNil() bool
	Close() error
}

SoftwareVersionChecker holds the actions needed to be handled by a components which will check the software version

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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