MCPcopy Create free account
hub / github.com/bitly/statsdaemon / TestProcessTimersUpperPercentilePostfix

Function TestProcessTimersUpperPercentilePostfix

statsdaemon_test.go:646–667  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

644}
645
646func TestProcessTimersUpperPercentilePostfix(t *testing.T) {
647 flag.Set("postfix", ".test")
648 // Some data with expected 75% of 2
649 timers = make(map[string]Float64Slice)
650 timers["postfix_response_time.test"] = []float64{0, 1, 2, 3}
651
652 now := int64(1418052649)
653
654 var buffer bytes.Buffer
655 num := processTimers(&buffer, now, Percentiles{
656 &Percentile{
657 75,
658 "75",
659 },
660 })
661
662 lines := bytes.Split(buffer.Bytes(), []byte("\n"))
663
664 assert.Equal(t, num, int64(1))
665 assert.Equal(t, string(lines[0]), "postfix_response_time.upper_75.test 2 1418052649")
666 flag.Set("postfix", "")
667}
668
669func TestProcessTimesLowerPercentile(t *testing.T) {
670 timers = make(map[string]Float64Slice)

Callers

nothing calls this directly

Calls 2

processTimersFunction · 0.85
SetMethod · 0.80

Tested by

no test coverage detected