From 7c87b718b23bf8e47f649154f5129449a94a9e17 Mon Sep 17 00:00:00 2001 From: Jess Yuen Date: Tue, 24 Mar 2020 23:32:01 -0700 Subject: [PATCH] Update statsd reporting README instructions * Fix invalid variable reference, s/r/reporter * Remove references to [legacy statsd client](https://github.com/cactus/go-statsd-client/blob/v3.2.0/statsd/client_legacy.go#L32) --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d36254fe..c6f6774e 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,13 @@ import ( ) func newScope() (tally.Scope, io.Closer) { - statter, _ := statsd.NewBufferedClient("127.0.0.1:8125", - "stats", 100*time.Millisecond, 1440) + statter, _ := statsd.NewClientWithConfig(&statsd.ClientConfig{ + Address: "127.0.0.1:8125", + Prefix: "stats", + UseBuffered: true, + FlushInterval: 100*time.Millisecond, + FlushBytes: 1440, + }) reporter := tallystatsd.NewReporter(statter, tallystatsd.Options{ SampleRate: 1.0, @@ -75,7 +80,7 @@ func newScope() (tally.Scope, io.Closer) { scope, closer := tally.NewRootScope(tally.ScopeOptions{ Prefix: "my-service", Tags: map[string]string{}, - Reporter: r, + Reporter: reporter, }, time.Second) return scope, closer