csvlogger

package
v1.8.27-dapper Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

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

Channel represents a logger channel tracking a single value

func (*Channel) Update

func (lc *Channel) Update(value float64)

Update updates the tracked value

type Logger

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

Logger is a metrics/events logger that writes logged values and events into a comma separated file

func NewLogger

func NewLogger(fileName string, updatePeriod time.Duration, eventHeader string) *Logger

NewLogger creates a new Logger

func (*Logger) Event

func (l *Logger) Event(event string)

Event immediately adds a new line and adds the given event string in the last column

func (*Logger) NewChannel

func (l *Logger) NewChannel(name string, threshold float64) *Channel

NewChannel creates a new value logger channel that writes values in a single column. If the relative change of the value is bigger than the given threshold then a new line is added immediately (threshold can also be 0).

func (*Logger) NewMinMaxChannel

func (l *Logger) NewMinMaxChannel(name string, zeroDefault bool) *Channel

NewMinMaxChannel creates a new value logger channel that writes the minimum and maximum of the tracked value in two columns. It never triggers adding a new line. If zeroDefault is true then 0 is written to both min and max columns if no update was given during the last period. If it is false then the last update will appear in both columns.

func (*Logger) Start

func (l *Logger) Start()

Start writes the header line and starts the logger

func (*Logger) Stop

func (l *Logger) Stop()

Stop stops the logger and closes the file

Jump to

Keyboard shortcuts

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