fix examples/tests with old epsilon param
Blake Mizerany
11 years ago
15 | 15 |
ch := make(chan float64)
|
16 | 16 |
go readFloats(ch)
|
17 | 17 |
|
18 | |
// Compute the 50th, 90th, and 99th percentile for a stream within the set error epsilon of 0.01.
|
19 | |
q := quantile.NewTargeted(0.01, 0.50, 0.90, 0.99)
|
|
18 |
// Compute the 50th, 90th, and 99th percentile.
|
|
19 |
q := quantile.NewTargeted(0.50, 0.90, 0.99)
|
20 | 20 |
for v := range ch {
|
21 | 21 |
q.Insert(v)
|
22 | 22 |
}
|
7 | 7 |
)
|
8 | 8 |
|
9 | 9 |
func TestQuantRandQuery(t *testing.T) {
|
10 | |
s := NewTargeted(0.01, 0.5, 0.90, 0.99)
|
|
10 |
s := NewTargeted(0.5, 0.90, 0.99)
|
11 | 11 |
a := make([]float64, 0, 1e5)
|
12 | 12 |
rand.Seed(42)
|
13 | 13 |
for i := 0; i < cap(a); i++ {
|
|
39 | 39 |
done := make(chan *Stream)
|
40 | 40 |
for i := 0; i < 2; i++ {
|
41 | 41 |
go func() {
|
42 | |
s := NewTargeted(0.01, 0.5, 0.90, 0.99)
|
|
42 |
s := NewTargeted(0.5, 0.90, 0.99)
|
43 | 43 |
for v := range ch {
|
44 | 44 |
s.Insert(v)
|
45 | 45 |
}
|