monitoring

package
v0.1.10-docs-prerelease Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 added in v0.1.11

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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