Documentation ¶
Index ¶
- type StatsdClient
- func (client *StatsdClient) Close()
- func (client *StatsdClient) Decrement(stat string)
- func (client *StatsdClient) DecrementWithSampling(stat string, sampleRate float32)
- func (client *StatsdClient) Increment(stat string)
- func (client *StatsdClient) IncrementWithSampling(stat string, sampleRate float32)
- func (client *StatsdClient) Open()
- func (client *StatsdClient) Send(data map[string]string, sampleRate float32)
- func (client *StatsdClient) Timing(stat string, time int64)
- func (client *StatsdClient) TimingWithSampleRate(stat string, time int64, sampleRate float32)
- func (client *StatsdClient) UpdateStats(stats []string, delta int, sampleRate float32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatsdClient ¶
func New ¶
func New(host string, port int) *StatsdClient
*
- Factory method to initialize udp connection
- Usage: *
- import "statsd"
- client := statsd.New('localhost', 8125) *
func (*StatsdClient) Decrement ¶
func (client *StatsdClient) Decrement(stat string)
*
- Decrements one stat counter without sampling
- Usage: *
- import "statsd"
- client := statsd.New('localhost', 8125)
- client.Decrement('foo.bar') *
func (*StatsdClient) DecrementWithSampling ¶
func (client *StatsdClient) DecrementWithSampling(stat string, sampleRate float32)
*
- Decrements one stat counter with sampling
- Usage: *
- import "statsd"
- client := statsd.New('localhost', 8125)
- client.Decrement('foo.bar', 0.2) *
func (*StatsdClient) Increment ¶
func (client *StatsdClient) Increment(stat string)
*
- Increments one stat counter without sampling
- Usage: *
- import "statsd"
- client := statsd.New('localhost', 8125)
- client.Increment('foo.bar') *
func (*StatsdClient) IncrementWithSampling ¶
func (client *StatsdClient) IncrementWithSampling(stat string, sampleRate float32)
*
- Increments one stat counter with sampling
- Usage: *
- import "statsd"
- client := statsd.New('localhost', 8125)
- client.Increment('foo.bar', 0.2) *
func (*StatsdClient) Open ¶
func (client *StatsdClient) Open()
*
- Method to open udp connection, called by default client factory *
func (*StatsdClient) Send ¶
func (client *StatsdClient) Send(data map[string]string, sampleRate float32)
*
- Sends data to udp statsd daemon *
func (*StatsdClient) Timing ¶
func (client *StatsdClient) Timing(stat string, time int64)
* Log timing information (in milliseconds) without sampling * Usage: * * import "statsd" * import "time" * client := statsd.New('localhost', 8125) * t1 := time.Now() * expensiveCall() * t2 := time.Now() * duration := int64(t2.Sub(t1)/time.Millisecond) * client.Timing("foo.time", duration) *
func (*StatsdClient) TimingWithSampleRate ¶
func (client *StatsdClient) TimingWithSampleRate(stat string, time int64, sampleRate float32)
*
- Log timing information (in milliseconds) with sampling
- Usage: *
- import "statsd"
- import "time"
- client := statsd.New('localhost', 8125)
- t1 := time.Now()
- expensiveCall()
- t2 := time.Now()
- duration := int64(t2.Sub(t1)/time.Millisecond)
- client.TimingWithSampleRate("foo.time", duration, 0.2) *
func (*StatsdClient) UpdateStats ¶
func (client *StatsdClient) UpdateStats(stats []string, delta int, sampleRate float32)
*
- Arbitrarily updates a list of stats by a delta *
Click to show internal directories.
Click to hide internal directories.