stats

package
v0.0.0-...-360c817 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: Apache-2.0 Imports: 7 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

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

func (*Counter) Decr

func (c *Counter) Decr()

Decr decrements the counter.

func (*Counter) DecrBy

func (c *Counter) DecrBy(v int64)

DecrBy decrements the counter by a value.

func (*Counter) Incr

func (c *Counter) Incr()

Incr increments the counter.

func (*Counter) IncrBy

func (c *Counter) IncrBy(v int64)

IncrBy increments the counter by a value.

func (*Counter) Value

func (c *Counter) Value() int64

Value returns the current value of the counter.

type Event

type Event map[string]interface{}

type Set

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

func (*Set) Get

func (s *Set) Get() interface{}

Get gets a value.

func (*Set) Set

func (s *Set) Set(value interface{})

Set sets a value.

type Stats

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

func New

func New(module string) (s *Stats)

New starts a stats daemon and returns the instance.

func (*Stats) Disable

func (s *Stats) Disable()

Disable disables logging stats

func (*Stats) Dump

func (s *Stats) Dump() ([]byte, error)

Dump returns statistics as JSON.

func (*Stats) Interval

func (s *Stats) Interval(n uint64)

Interval sets interval (seconds) to write data to stdout / stderr. Default is 5 seconds.

func (*Stats) NewCounter

func (s *Stats) NewCounter(name string) (c *Counter)

NewCounter returns a Counter instance.

func (*Stats) NewSet

func (s *Stats) NewSet(name string) (st *Set)

NewSet returns a Set instance.

func (*Stats) NewTimer

func (s *Stats) NewTimer(name string) (t *Timer)

NewTimer starts the timer.

func (*Stats) RemoveCounter

func (s *Stats) RemoveCounter(c *Counter)

RemoveCounter will remove the counter from stats list

type Timer

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

func (*Timer) Stop

func (t *Timer) Stop()

Stop stops the timer.

Jump to

Keyboard shortcuts

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