metric

package
v0.0.0-...-51b3ee1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2016 License: Apache-2.0 Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	Collect() ([]Event, error)
}

Collector collects metric events.

type Emitter

type Emitter interface {
	// Emit should try to emit the specified event.
	Emit(Event) error
}

Emitter emits specified events.

type Event

type Event struct {
	Name string
	// could be int, float32 or float64
	Value interface{}
}

Event repesents generic metric event.

type Option

type Option func(*Reporter)

func Interval

func Interval(d time.Duration) Option

type Reporter

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

Reporter periodically collects and emits metrics.

func NewReporter

func NewReporter(e Emitter, collectors []Collector, opts ...Option) *Reporter

NewReporter returns brand new reporter.

func (*Reporter) Close

func (r *Reporter) Close()

Close releases all resources allocated by the reporter.

func (*Reporter) Start

func (r *Reporter) Start()

Start starts collecting and emitting metric events. It does so in its own goroutine. See Close for stopping.

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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