metrics

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	// metrics variables
	StartExecTime, StartLexerTime, StartParserTime, StartInterpreterTime time.Time
	TotalExecTime, LexerExecTime, ParserExecTime, InterpreterExecTime    time.Duration
	FCalls, StackSize, HeapSize, MinMem, MaxMem, MinCpu, MaxCpu          int
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics() *Metrics

NewMetrics returns a new Metrics.

func (*Metrics) Measure

func (m *Metrics) Measure()

Measure retrieves and prints the metrics.

func (*Metrics) StartInterpreterTimer

func (m *Metrics) StartInterpreterTimer()

StartInterpreterTimer starts the interpreter timer.

func (*Metrics) StartLexerTimer

func (m *Metrics) StartLexerTimer()

StartLexerTimer starts the lexer timer.

func (*Metrics) StartParserTimer

func (m *Metrics) StartParserTimer()

StartParserTimer starts the parser timer.

func (*Metrics) StartTimers

func (m *Metrics) StartTimers()

StartTimers starts the timers.

func (*Metrics) StopInterpreterTimer

func (m *Metrics) StopInterpreterTimer()

StopInterpreterTimer stops the interpreter timer.

func (*Metrics) StopLexerTimer

func (m *Metrics) StopLexerTimer()

StopLexerTimer stops the lexer timer.

func (*Metrics) StopParserTimer

func (m *Metrics) StopParserTimer()

StopParserTimer stops the parser timer.

func (*Metrics) StopTotalTimer

func (m *Metrics) StopTotalTimer()

StopTotalTimer stops the total timer.

type MetricsReader

type MetricsReader interface {
	Read([]metrics.Sample)
}

type MockMetricsReader

type MockMetricsReader struct {
	SamplesToReturn []metrics.Sample
}

func (*MockMetricsReader) Read

func (mmr *MockMetricsReader) Read(samples []metrics.Sample)

Jump to

Keyboard shortcuts

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