Codebase list golang-github-beorn7-perks / 20433c1
fix examples/tests with old epsilon param Blake Mizerany 11 years ago
2 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
1515 ch := make(chan float64)
1616 go readFloats(ch)
1717
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)
2020 for v := range ch {
2121 q.Insert(v)
2222 }
77 )
88
99 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)
1111 a := make([]float64, 0, 1e5)
1212 rand.Seed(42)
1313 for i := 0; i < cap(a); i++ {
3939 done := make(chan *Stream)
4040 for i := 0; i < 2; i++ {
4141 go func() {
42 s := NewTargeted(0.01, 0.5, 0.90, 0.99)
42 s := NewTargeted(0.5, 0.90, 0.99)
4343 for v := range ch {
4444 s.Insert(v)
4545 }