Closed JamesCohen-awin closed 9 years ago
also of note for whoever reviews this...
I removed the test from statsdaemon_test.go#L286 as the test string shouldn't appear in the output and wasn't being - even though the test was passing(!)
curious what go test -cover
reports before/after this change? would you mind pasting?
coverage reduces a tiny bit
$ diff /tmp/cover-master.txt /tmp/cover-tidyup.txt
13c13
< github.com/bitly/statsdaemon/statsdaemon.go:226: processTimers 100.0%
---
> github.com/bitly/statsdaemon/statsdaemon.go:226: processTimers 97.4%
17c17
< total: (statements) 56.2%
---
> total: (statements) 55.6%
It's the "continue" here that is no longer covered:
func processTimers(buffer *bytes.Buffer, now int64, pctls Percentiles) int64 {
var num int64
for u, t := range timers {
if len(t) == 0 {
continue
}
k, thanks again :grin:
I tidied up some of the tests:
time.Now().Unix()
a constant is used instead to remove variables from the test and to make simpler (string == string) assertions