metrics

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InMicroseconds

func InMicroseconds(d time.Duration) float64

Types

type Adder

type Adder func(float64, ...string)

func (Adder) Int

func (a Adder) Int(x int, s ...string)

Int adds the value of `x`; convenience func for adding integers.

type Counter

type Counter func(...string)

type Harness

type Harness func(func() error, ...string) error

Harness funcs execute the given func and record metrics concerning the execution. The error returned from the harness is the same error returned from the execution of the func param.

func NewHarness

func NewHarness(counts, errors Counter, timed Watcher, clock func() time.Time) Harness

NewHarness generates and returns an execution harness that records metrics. `counts` and `errors` are required; `timed` and `clock` must either both be nil, or both be non-nil.

type Watcher

type Watcher func(float64, ...string)

func (Watcher) Since

func (w Watcher) Since(t time.Time, s ...string)

Since records an observation of time.Now().Sub(t) in microseconds

Jump to

Keyboard shortcuts

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