(t *testing.T)
| 516 | } |
| 517 | |
| 518 | func TestProcessTimers(t *testing.T) { |
| 519 | // Some data with expected mean of 20 |
| 520 | timers = make(map[string]Float64Slice) |
| 521 | timers["response_time"] = []float64{0, 30, 30} |
| 522 | |
| 523 | now := int64(1418052649) |
| 524 | |
| 525 | var buffer bytes.Buffer |
| 526 | num := processTimers(&buffer, now, Percentiles{}) |
| 527 | |
| 528 | lines := bytes.Split(buffer.Bytes(), []byte("\n")) |
| 529 | |
| 530 | assert.Equal(t, num, int64(1)) |
| 531 | assert.Equal(t, string(lines[0]), "response_time.mean 20 1418052649") |
| 532 | assert.Equal(t, string(lines[1]), "response_time.upper 30 1418052649") |
| 533 | assert.Equal(t, string(lines[2]), "response_time.lower 0 1418052649") |
| 534 | assert.Equal(t, string(lines[3]), "response_time.count 3 1418052649") |
| 535 | |
| 536 | num = processTimers(&buffer, now, Percentiles{}) |
| 537 | assert.Equal(t, num, int64(0)) |
| 538 | } |
| 539 | |
| 540 | func TestProcessGauges(t *testing.T) { |
| 541 | flag.Set("delete-gauges", "false") |
nothing calls this directly
no test coverage detected