You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
603 B
33 lines
603 B
package datadog
|
|
|
|
import "github.com/DataDog/datadog-go/statsd"
|
|
|
|
// Option is datadog option.
|
|
type Option func(*options)
|
|
|
|
type options struct {
|
|
sampleRate float64
|
|
labels []string
|
|
client *statsd.Client
|
|
}
|
|
|
|
// WithSampleRate with sample rate option.
|
|
func WithSampleRate(rate float64) Option {
|
|
return func(o *options) {
|
|
o.sampleRate = rate
|
|
}
|
|
}
|
|
|
|
// WithLabels with labels option.
|
|
func WithLabels(lvs ...string) Option {
|
|
return func(o *options) {
|
|
o.labels = lvs
|
|
}
|
|
}
|
|
|
|
// WithClient with client option.
|
|
func WithClient(c *statsd.Client) Option {
|
|
return func(o *options) {
|
|
o.client = c
|
|
}
|
|
}
|
|
|