stats

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Timer

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

A Timer that can be started and stopped and accumulates the total time it was running (the time between Start() and Stop()).

func (*Timer) Duration

func (t *Timer) Duration() float64

Duration returns the duration value of the timer in seconds.

func (*Timer) ElapsedTime

func (t *Timer) ElapsedTime() time.Duration

ElapsedTime returns the time that passed since starting the timer.

func (*Timer) Start

func (t *Timer) Start() *Timer

Start the timer.

func (*Timer) Stop

func (t *Timer) Stop()

Stop the timer.

func (*Timer) String

func (t *Timer) String() string

Return a string representation of the Timer.

type TimerGroup

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

A TimerGroup represents a group of timers relevant to a single query.

func NewTimerGroup

func NewTimerGroup() *TimerGroup

NewTimerGroup constructs a new TimerGroup.

func (*TimerGroup) GetTimer

func (t *TimerGroup) GetTimer(name fmt.Stringer) *Timer

GetTimer gets (and creates, if necessary) the Timer for a given code section.

func (*TimerGroup) String

func (t *TimerGroup) String() string

Return a string representation of a TimerGroup.

type Timers

type Timers []*Timer

Timers is a slice of Timer pointers that implements Len and Swap from sort.Interface.

func (Timers) Len

func (t Timers) Len() int

Len implements sort.Interface.

func (Timers) Swap

func (t Timers) Swap(i, j int)

Swap implements sort.Interface.

Jump to

Keyboard shortcuts

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