Version: v0.0.0-...-88424db Latest Latest

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

Go to latest
Published: Mar 11, 2015 License: Apache-2.0 Imports: 6 Imported by: 0



Package stats provides a simple method for exporting statistics to HTTP.



This section is empty.


View Source
var S = &Stats{vars: map[string]*Stat{}}

S is a Stats singleton.


This section is empty.


type Stat

type Stat struct {
	// contains filtered or unexported fields

Stat provides a method of exporting a single named variable.

func (*Stat) Increment

func (s *Stat) Increment()

Increment increments this stat by 1.

func (*Stat) IncrementBy

func (s *Stat) IncrementBy(delta int64)

IncrementBy increments this stat by the given delta.

func (*Stat) NanoTimer

func (s *Stat) NanoTimer() func()

func (*Stat) Set

func (s *Stat) Set(val int64)

Set sets the value of this stat to the given val.

type Stats

type Stats struct {
	// contains filtered or unexported fields

Stats provides a mapping of named variables.

func (*Stats) Get

func (s *Stats) Get(name string) *Stat

Get returns the stat with the given name, creating it if necessary.

func (*Stats) ServeHTTP

func (s *Stats) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP makes Stats an http.Handler.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL