package module
Version: v0.0.0-...-d61fa1b Latest Latest

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

Go to latest
Published: Apr 13, 2016 License: MIT Imports: 7 Imported by: 0



Generic GoLang internals instrumentation

Build Status GitHub license


package main

import "github.com/samarudge/go-stats"

func main(){
	gostats.Start("statsd-host:8125", 10, "application-name")

For a sample Grafana dashboard see graphite.json

Metrics exported;

Metric Source Description Unit
cgo.calls runtime.NumCgoCall() Number of Cgo Calls calls per second
gc.pauseTimeMs runtime.ReadMemStats Pause time of last GC run MS
gc.pauseTimeNs runtime.ReadMemStats Pause time of last GC run NS
gc.period runtime.ReadMemStats Time between last two GC runs MS
gc.perSecond runtime.ReadMemStats Number of GCs per second runs per second
goroutines.total runtime.NumGoroutine() Number of currently running goroutines total
memory.counters.Frees runtime.ReadMemStats.Frees Number of frees issued to the system frees per second
memory.counters.Mallocs runtime.ReadMemStats.Mallocs Number of Mallocs issued to the system mallocs per second
memory.heap.Idle runtime.ReadMemStats.HeapIdle Memory on the heap not in use bytes
memory.heap.InUse runtime.ReadMemStats.HeapInuse Memory on the heap in use bytes
memory.objects.HeapObjects runtime.ReadMemStats.HeapObjects Total objects on the heap # Objects
memory.summary.Alloc runtime.ReadMemStats.Alloc Total bytes allocated bytes
memory.summary.System runtime.ReadMemStats.HeapSys Total bytes acquired from system bytes

More documentation coming soon...




This section is empty.


This section is empty.


This section is empty.


type GoStats

type GoStats struct {
	ClientName   string
	Hostname     string
	PushInterval time.Duration
	StatsdHost   string
	PushTicker   *time.Ticker
	Conn         *statsd.StatsdClient
	Collectors   collectorList

func New

func New() *GoStats

func Start

func Start(statsdHost string, pushInterval int, clientName string) (*GoStats, error)

func (*GoStats) MetricBase

func (s *GoStats) MetricBase() string

func (*GoStats) Start

func (s *GoStats) Start() error

func (*GoStats) Stop

func (s *GoStats) Stop()


Path Synopsis

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