tracer

package module
v0.0.0-...-0b816a6 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Tracer provides a concrete Tracer implementation. Tracer is designed to provide access to timers quickly in high read contention scenarios. Depends on github.com/rcrowley/go-metrics

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TracedFunc

type TracedFunc func(*Tracer)

A function that takes a Tracer

type Tracer

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

Tracer is a struct that implements the `metrics.Timer` interface and provides hooks for timing blocks of code.

func NewTracer

func NewTracer(path string) *Tracer

func (*Tracer) Count

func (t *Tracer) Count() int64

func (*Tracer) GetOrRegister

func (t *Tracer) GetOrRegister(pathComponent string) *Tracer

func (*Tracer) GetRegistry

func (t *Tracer) GetRegistry() metrics.Registry

func (*Tracer) Max

func (t *Tracer) Max() int64

func (*Tracer) Mean

func (t *Tracer) Mean() float64

func (*Tracer) Min

func (t *Tracer) Min() int64

func (*Tracer) Path

func (t *Tracer) Path() string

Path of the Tracer

func (*Tracer) Percentile

func (t *Tracer) Percentile(p float64) float64

func (*Tracer) Percentiles

func (t *Tracer) Percentiles(pcts []float64) []float64

func (*Tracer) Rate1

func (t *Tracer) Rate1() float64

func (*Tracer) Rate15

func (t *Tracer) Rate15() float64

func (*Tracer) Rate5

func (t *Tracer) Rate5() float64

func (*Tracer) RateMean

func (t *Tracer) RateMean() float64

func (*Tracer) Snapshot

func (t *Tracer) Snapshot() metrics.Timer

func (*Tracer) StdDev

func (t *Tracer) StdDev() float64

func (*Tracer) Sum

func (t *Tracer) Sum() int64

func (*Tracer) Time

func (t *Tracer) Time(f func())

func (*Tracer) TimeFunc

func (t *Tracer) TimeFunc(pathComponent string, tracedFunc TracedFunc)

TimeFunc times the function passed in, with the path of the current Tracer, appending ".pathComponent" to its trace path. The tracer passed to `tracedFunc` can be used to further add to the trace.

func (*Tracer) Update

func (t *Tracer) Update(d time.Duration)

func (*Tracer) UpdateSince

func (t *Tracer) UpdateSince(since time.Time)

func (*Tracer) Variance

func (t *Tracer) Variance() float64

Jump to

Keyboard shortcuts

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