-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tag support in statsd reporter | Upgrade go-statsd-client #163
base: master
Are you sure you want to change the base?
Add tag support in statsd reporter | Upgrade go-statsd-client #163
Conversation
) | ||
|
||
// To view statsd emitted metrics locally you can use | ||
// netcat with "nc 8125 -l -u" | ||
func main() { | ||
statter, err := statsd.NewBufferedClient("127.0.0.1:8125", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is deprecated now
|
||
counter := scope.Counter("test-counter") | ||
defer func(closer io.Closer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closer.close
returns an error
} | ||
|
||
func (r *cactusStatsReporter) Flush() { | ||
// no-op | ||
} | ||
|
||
func getStatsdTagPairs(tags map[string]string) []statsd.Tag { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~/gocode/src/github.com/uber-go/tally/statsd master !4 ?1 ❯ go test . -run none -bench BenchmarkGetStatsdTagPairs --benchtime 3s -benchmem ▼
goos: darwin
goarch: amd64
pkg: github.com/uber-go/tally/statsd
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkGetStatsdTagPairs-12 31455973 105.0 ns/op 64 B/op 1 allocs/op
PASS
ok github.com/uber-go/tally/statsd 3.943s
- Benchmark
func BenchmarkGetStatsdTagPairs(b *testing.B) {
tags := map[string]string{
"K1": "V1",
"K2": "V2",
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = getStatsdTagPairs(tags)
}
}
Summary
Description
This PR adds / changes the following
cactus-statsd-client
tov5
Motivation & Context
How was this tested?
offset=-34.34
anddev=local
Bench stats
Here's the benchstat between old (master) and new (this branch)