timer

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2017 License: MIT Imports: 3 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

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

Log struct is Timer interface implementation that writes all timings to log

func (*Log) Finish

func (t *Log) Finish(bucket string)

Finish writes elapsed time for metric to log

func (*Log) Start

func (t *Log) Start() Timer

Start starts timer

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) Elapsed

func (t *Memory) Elapsed() Metric

Elapsed returns elapsed duration

func (*Memory) Finish

func (t *Memory) Finish(bucket string)

Finish stores elapsed duration in memory

func (*Memory) Start

func (t *Memory) Start() Timer

Start starts timer

type Metric

type Metric struct {
	Bucket  string
	Elapsed time.Duration
}

Metric is a type for storing single duration metric

type Statsd

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

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

func (*Statsd) Finish

func (t *Statsd) Finish(bucket string)

Finish writes elapsed time for metric to statsd

func (*Statsd) Start

func (t *Statsd) Start() Timer

Start starts timer

type Timer

type Timer interface {
	// Start starts timer
	Start() Timer
	// Finish writes elapsed time for metric
	Finish(bucket string)
}

Timer is a metric time tracking interface

func New

func New(c *statsd.Client, muted bool) Timer

New builds and returns new Timer instance

Jump to

Keyboard shortcuts

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