Codebase list golang-github-beorn7-perks / 7f3921c
feedback from @nf Blake Mizerany 11 years ago
2 changed file(s) with 5 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
00 // +build go1.1
1
12 package quantile_test
23
34 import (
6263 // minute.
6364
6465 ch := make(chan float64)
65 go readStreamValues(ch)
66 go sendStreamValues(ch)
6667
6768 tick := time.NewTicker(1 * time.Minute)
6869 q := quantile.NewTargeted(0.90, 0.95, 0.99)
7778 }
7879 }
7980
80 func readStreamValues(ch chan float64) {
81 func sendStreamValues(ch chan float64) {
8182 // Use your imagination
8283 }
8384
7575 return newStream(f)
7676 }
7777
78 // Stream calculates quantiles for a stream of float64s.
78 // Stream computes quantiles for a stream of float64s.
7979 type Stream struct {
8080 *stream
8181 b Samples
100100 }
101101 }
102102
103 // Query returns the calculated qth percentiles value. If s was created with
103 // Query returns the computes qth percentiles value. If s was created with
104104 // NewTargeted, and q is not in the set of quantiles provided a priori, Query
105105 // will return an unspecified result.
106106 func (s *Stream) Query(q float64) float64 {