mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
specify the StatsD host string
This commit is contained in:
parent
465f9806c6
commit
fea18bc14b
2 changed files with 6 additions and 3 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue