Back to godoc.org

Package monitoring

v0.1.10-docs-prerelease
Latest Go to latest

The highest tagged major version is .

Published: Apr 17, 2020 | License: MIT | Module: github.com/spacemeshos/go-spacemesh

Index

type MemoryUpdater

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

MemoryUpdater tracks mem stats provided by runtime.ReadMemStats such as Alloc, NumGoroutine etc

func NewMemoryUpdater

func NewMemoryUpdater() *MemoryUpdater

NewMemoryUpdater returns a new tracker instance

func (*MemoryUpdater) LogJSON

func (mu *MemoryUpdater) LogJSON()

LogJSON returns a string description of the current status as JSON

func (*MemoryUpdater) Status

func (mu *MemoryUpdater) Status() string

Status returns a string description of the stats collected for the memory trackers <min, max, avg>

func (*MemoryUpdater) Update

func (mu *MemoryUpdater) Update()

Update takes a new sample and adds it to statistics

type Monitor

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

Monitor is a simple service to take samples

func NewMonitor

func NewMonitor(updateRate time.Duration, printRate time.Duration, updater recorder, termChannel chan struct{}) *Monitor

NewMonitor constructs a new monitor instance

func (*Monitor) Start

func (m *Monitor) Start()

Start monitoring

type Tracker

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

Tracker tracks uint64 values and provides stats on the tracked values: min, max, avg

func NewTracker

func NewTracker() *Tracker

NewTracker returns a new empty tracker

func (*Tracker) Avg

func (t *Tracker) Avg() float64

Avg return the average of all samples

func (*Tracker) IsEmpty

func (t *Tracker) IsEmpty() bool

IsEmpty returns true iff no sample has been recorder yet

func (*Tracker) Max

func (t *Tracker) Max() uint64

Max returns the maximal sample

func (*Tracker) Min

func (t *Tracker) Min() uint64

Min returns the minimal sample

func (*Tracker) Track

func (t *Tracker) Track(value uint64)

Track the provided value

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier