timer

package
v0.0.0-...-a2ef928 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: Apache-2.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 Phase

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

Represents a phase of a test. Phases can overlap.

func (*Phase) End

func (phase *Phase) End()

End marks the phase as ended, unless it had already been ended before.

type TestPhaseTimer

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

A TestPhaseTimer groups phases and provides a way to export their measurements as JSON or human-readable text. It is safe to use concurrently.

func NewTestPhaseTimer

func NewTestPhaseTimer() *TestPhaseTimer

NewTestPhaseTimer creates a new TestPhaseTimer.

func (*TestPhaseTimer) PrintHumanReadable

func (timer *TestPhaseTimer) PrintHumanReadable() string

func (*TestPhaseTimer) PrintJSON

func (timer *TestPhaseTimer) PrintJSON() string

func (*TestPhaseTimer) StartPhase

func (timer *TestPhaseTimer) StartPhase(sequenceNumber int, phaseName string) *Phase

StartPhase starts a new phase. sequenceNumber is an integer prepended to phaseName in the output, such that lexicographic sorting of phases in perfdash reconstructs the order of execution. Unfortunately it needs to be provided manually, since a simple incrementing counter would have the effect that inserting a new phase would renumber subsequent phases, breaking the continuity of historical records.

func (*TestPhaseTimer) SummaryKind

func (timer *TestPhaseTimer) SummaryKind() string

Jump to

Keyboard shortcuts

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