timer_metrics

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: MIT Imports: 6 Imported by: 150

README

timer_metrics

Build Status GoDoc GitHub release

A efficient way to capture timing information and periodically output metrics

See https://godoc.org/github.com/bitly/timer_metrics

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

type Stats struct {
	Prefix string
	Count  int
	Avg    time.Duration
	P95    time.Duration
	P99    time.Duration
}

func (*Stats) String

func (s *Stats) String() string

type TimerMetrics

type TimerMetrics struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewTimerMetrics

func NewTimerMetrics(statusEvery int, prefix string) *TimerMetrics

start a new TimerMetrics to print out metrics every n times

func (*TimerMetrics) Stats

func (m *TimerMetrics) Stats() *Stats

get the current Stats

func (*TimerMetrics) Status

func (m *TimerMetrics) Status(startTime time.Time)

record a delta from time.Now()

func (*TimerMetrics) StatusDuration

func (m *TimerMetrics) StatusDuration(duration time.Duration)

Record a duration, printing out stats every statusEvery interval

Jump to

Keyboard shortcuts

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