package metrics

import "github.com/mesos/mesos-go/api/v1/lib/extras/metrics"

Index

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

Source Files

metrics.go

Version
v0.0.11 (latest)
Published
May 15, 2020
Platform
linux/amd64
Imports
1 packages
Last checked
5 hours ago

Tools for package owners.