metrics

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBufferSize = 8096
)

Variables

View Source
var (
	BufferSize = DefaultBufferSize
)

Functions

func Counter

func Counter(key string) *counter

func CounterAt

func CounterAt(key string, i int) *counter

func CounterAt64

func CounterAt64(key string, i int64) *counter

func Initialize

func Initialize(done <-chan struct{}, backend Backend)

func Timer

func Timer(key string) *timer

Types

type Backend

type Backend interface {
	Timer(key string, dur time.Duration, tags ...string)
	Counter(key string, count int64, tags ...string)
}

type Metric

type Metric interface {
	Emit()
}

Metric represents a statsite metric

type NopBackend

type NopBackend struct {
}

func (*NopBackend) Counter

func (t *NopBackend) Counter(key string, count int64, tags ...string)

func (*NopBackend) Timer

func (t *NopBackend) Timer(key string, dur time.Duration, tags ...string)

type Processor

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

func NewProcessor

func NewProcessor(done <-chan struct{}, backend Backend) *Processor

func (*Processor) Loop

func (t *Processor) Loop()

func (*Processor) NewCounter

func (t *Processor) NewCounter(key string, count int64) *counter

func (*Processor) NewTimer

func (t *Processor) NewTimer(key string, start time.Time) *timer

func (*Processor) Publish

func (t *Processor) Publish(metric Metric)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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