Documentation ¶
Overview ¶
Package metrics provides application metrics registration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StatsDPackMax = 1432
StatsDPackMax is the maximum packet size for batches. Be carefull not to exceed the network's MTU. See https://github.com/etsy/statsd/blob/master/docs/metric_types.md#multi-metric-packets
Functions ¶
This section is empty.
Types ¶
type Register ¶
type Register interface { // Seen increments the counter with n. Seen(key string, n int) // Took adds a timing from since to now. Took(key string, since time.Time) // KeyPrefix defines a prefix applied to all keys. KeyPrefix(string) }
func NewStatsD ¶
NewStatsD returns a new Register with a StatsD implementation. Generally speaking, you want to connect over UDP.
conn, err := net.DialTimeout("udp", "localhost:8125", 4*time.Second) if err != nil { ... } stats := metrics.NewStatsD(conn, time.Second)
Batches are limited by the flushInterval span. A flushInterval of 0 implies no buffering.
Click to show internal directories.
Click to hide internal directories.