specify the StatsD host string

This commit is contained in:
Michael Baird 2017-04-19 17:21:08 -05:00
parent 465f9806c6
commit fea18bc14b
2 changed files with 6 additions and 3 deletions

View file

@ -10,6 +10,9 @@ import (
"github.com/pilosa/pilosa"
)
// StatsD protocal wrapper using the DataDog library that added Tags to the StatsD protocal
// statsD defailt host is "127.0.0.1:8125"
const (
// Rate represents a metric rate of 1/sec.
Rate = 1
@ -30,8 +33,8 @@ type StatsClient struct {
}
// NewStatsClient returns a new instance of StatsClient.
func NewStatsClient() (*StatsClient, error) {
c, err := statsd.NewBuffered("127.0.0.1:8125", BufferLen)
func NewStatsClient(host string) (*StatsClient, error) {
c, err := statsd.NewBuffered(host, BufferLen)
if err != nil {
return nil, err
}

View file

@ -9,7 +9,7 @@ import (
func TestStatsClient_WithTags(t *testing.T) {
// Create a new client.
c, err := datadog.NewStatsClient()
c, err := datadog.NewStatsClient("localhost:19444")
if err != nil {
t.Fatal(err)
}