timer

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: MIT Imports: 1 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration added in v0.8.0

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

Duration struct is Timer interface implementation that writes all timings to statsd

func NewDuration added in v0.8.0

func NewDuration(duration time.Duration) *Duration

NewDuration creates new duration timer instance

func (*Duration) Finish added in v0.8.0

func (t *Duration) Finish() time.Duration

Finish writes elapsed time for metric to statsd

func (*Duration) Start added in v0.8.0

func (t *Duration) Start() Timer

Start starts timer

func (*Duration) StartAt added in v0.8.0

func (t *Duration) StartAt(s time.Time) Timer

StartAt starts timer at a given time

type Memory

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

Memory struct is Timer interface implementation that stores results in memory for further usage

func (*Memory) Finish

func (t *Memory) Finish() time.Duration

Finish returns elapsed duration

func (*Memory) Start

func (t *Memory) Start() Timer

Start starts timer

func (*Memory) StartAt added in v0.6.3

func (t *Memory) StartAt(s time.Time) Timer

StartAt starts timer at a given time

type Timer

type Timer interface {
	// Start starts timer
	Start() Timer
	// StartAt starts timer at a given time
	StartAt(time.Time) Timer
	// Finish returns elapsed time
	Finish() time.Duration
}

Timer is a metric time tracking interface

Jump to

Keyboard shortcuts

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