timer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: MIT Imports: 1 Imported by: 5 modules, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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