bmizerany/perks — pull request #10 by aybabtme (2014-05-03 06:28:30+00:00)
Title: Reproduces issue 8

This seems to reproduce the situation described in issue #8.

However, I'm not sure if this behavior (near-zero values) is unexpected if the stream is reset often after reading a very few values... but I'm no expert on the domain.

The output looks like this:

```bash
$ go test ./...
--- FAIL: TestDoesntDegradeAfterResets (2.53 seconds)
regression_test.go:22: perc50: want 0.5034867900486911, got 0.0014115440248851888
regression_test.go:23: e: 0.997196
regression_test.go:60: failed at second 15, 3 qps
regression_test.go:22: perc50: want 0.48769729658334754, got 0.9819681965218967
regression_test.go:23: e: 1.013479
regression_test.go:60: failed at second 799, 1 qps
regression_test.go:22: perc50: want 0.4886489836954619, got 0.003647536279147103
regression_test.go:23: e: 0.992535
regression_test.go:22: perc90: want 0.8853796193381923, got 0.003647536279147103
regression_test.go:23: e: 0.995880
regression_test.go:22: perc99: want 0.9791097199218912, got 0.003647536279147103
regression_test.go:23: e: 0.996275
regression_test.go:60: failed at second 1530, 1 qps
regression_test.go:22: perc50: want 0.48757831397216517, got 0.0020130646351263133
regression_test.go:23: e: 0.995871
regression_test.go:60: failed at second 2023, 3 qps
regression_test.go:22: perc99: want 0.9777245237282928, got 0.009280767616650837
regression_test.go:23: e: 0.990508
regression_test.go:60: failed at second 3221, 2 qps
FAIL
FAIL	github.com/bmizerany/perks/quantile	3.617s
```