stats

package
v0.0.0-...-e05c840 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2016 License: MIT Imports: 9 Imported by: 9

Documentation

Index

Constants

View Source
const (
	DefaultSampleSize = 1000
	Latency           = "Latency"
	TaskWait          = "TaskWait"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Basic

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

func NewBasicStats

func NewBasicStats() *Basic

func (*Basic) Add

func (b *Basic) Add(name string, dur time.Duration)

func (*Basic) Error

func (b *Basic) Error(name string)

func (*Basic) Fetch

func (b *Basic) Fetch(name string) Stats

func (*Basic) Reset

func (b *Basic) Reset()

type Group

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

func NewGroup

func NewGroup(backends ...Publisher) *Group

func (*Group) Add

func (g *Group) Add(name string, dur time.Duration)

func (*Group) Error

func (g *Group) Error(name string)

type Logger

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

func NewLogger

func NewLogger(out io.Writer, interval time.Duration) *Logger

func NewStdoutLogger

func NewStdoutLogger(interval time.Duration) *Logger

func (*Logger) Add

func (b *Logger) Add(name string, dur time.Duration)

func (*Logger) Error

func (b *Logger) Error(name string)

func (*Logger) Fetch

func (b *Logger) Fetch(name string) Stats

func (*Logger) Print

func (l *Logger) Print()

func (*Logger) Reset

func (b *Logger) Reset()

type Manager

type Manager interface {
	Publisher
	Fetch(name string) Stats
	Reset()
}

type Publisher

type Publisher interface {
	Add(name string, dur time.Duration)
	Error(name string)
}

type Server

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

func NewServer

func NewServer() *Server

func (*Server) Add

func (b *Server) Add(name string, dur time.Duration)

func (*Server) Error

func (b *Server) Error(name string)

func (*Server) Fetch

func (b *Server) Fetch(name string) Stats

func (*Server) History

func (s *Server) History(rw http.ResponseWriter, _ *http.Request)

func (*Server) Reset

func (b *Server) Reset()

type Stats

type Stats interface {
	Processed() int64
	Errors() int64
	Min() int64
	Mean() float64
	P95() float64
	Max() int64
	StdDev() float64
}

type Void

type Void struct{}

func (*Void) Add

func (v *Void) Add(name string, dur time.Duration)

func (*Void) Error

func (v *Void) Error(name string)

Jump to

Keyboard shortcuts

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