From 14c2f30b35598cb939a2a67f1a8a911cec1bb34d Mon Sep 17 00:00:00 2001 From: beorn7 Date: Mon, 23 Feb 2015 14:59:14 +0100 Subject: [PATCH] Update vendoring of beorn7/perks. --- _vendor/perks/MANIFEST | 2 +- _vendor/perks/quantile/example_test.go | 21 +++++++++++++++------ _vendor/perks/quantile/stream_test.go | 9 ++++++--- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/_vendor/perks/MANIFEST b/_vendor/perks/MANIFEST index 1fb6e82..7af0205 100644 --- a/_vendor/perks/MANIFEST +++ b/_vendor/perks/MANIFEST @@ -1 +1 @@ -Imported at f15ca8fc2964cb9f291e1cf17bb1bf9a4f9e23d5 from https://github.com/beorn7/perks . +Imported at b965b613227fddccbfffe13eae360ed3fa822f8d from https://github.com/beorn7/perks . diff --git a/_vendor/perks/quantile/example_test.go b/_vendor/perks/quantile/example_test.go index 43121e2..ab3293a 100644 --- a/_vendor/perks/quantile/example_test.go +++ b/_vendor/perks/quantile/example_test.go @@ -5,11 +5,12 @@ package quantile_test import ( "bufio" "fmt" - "github.com/bmizerany/perks/quantile" "log" "os" "strconv" "time" + + "github.com/beorn7/perks/quantile" ) func Example_simple() { @@ -17,7 +18,11 @@ func Example_simple() { go sendFloats(ch) // Compute the 50th, 90th, and 99th percentile. - q := quantile.NewTargeted(0.50, 0.90, 0.99) + q := quantile.NewTargeted(map[float64]float64{ + 0.50: 0.005, + 0.90: 0.001, + 0.99: 0.0001, + }) for v := range ch { q.Insert(v) } @@ -28,8 +33,8 @@ func Example_simple() { fmt.Println("count:", q.Count()) // Output: // perc50: 5 - // perc90: 14 - // perc99: 40 + // perc90: 16 + // perc99: 223 // count: 2388 } @@ -52,7 +57,7 @@ func Example_mergeMultipleStreams() { // even if we do not plan to query them all here. ch := make(chan quantile.Samples) getDBQuerySamples(ch) - q := quantile.NewTargeted(0.90) + q := quantile.NewTargeted(map[float64]float64{0.90: 0.001}) for samples := range ch { q.Merge(samples) } @@ -67,7 +72,11 @@ func Example_window() { go sendStreamValues(ch) tick := time.NewTicker(1 * time.Minute) - q := quantile.NewTargeted(0.90, 0.95, 0.99) + q := quantile.NewTargeted(map[float64]float64{ + 0.90: 0.001, + 0.95: 0.0005, + 0.99: 0.0001, + }) for { select { case t := <-tick.C: diff --git a/_vendor/perks/quantile/stream_test.go b/_vendor/perks/quantile/stream_test.go index 707b871..4dba054 100644 --- a/_vendor/perks/quantile/stream_test.go +++ b/_vendor/perks/quantile/stream_test.go @@ -113,7 +113,8 @@ func TestHighBiasedQuery(t *testing.T) { verifyHighPercsWithRelativeEpsilon(t, a, s) } -func TestTargetedMerge(t *testing.T) { +// BrokenTestTargetedMerge is broken, see Merge doc comment. +func BrokenTestTargetedMerge(t *testing.T) { rand.Seed(42) s1 := NewTargeted(Targets) s2 := NewTargeted(Targets) @@ -123,7 +124,8 @@ func TestTargetedMerge(t *testing.T) { verifyPercsWithAbsoluteEpsilon(t, a, s1) } -func TestLowBiasedMerge(t *testing.T) { +// BrokenTestLowBiasedMerge is broken, see Merge doc comment. +func BrokenTestLowBiasedMerge(t *testing.T) { rand.Seed(42) s1 := NewLowBiased(RelativeEpsilon) s2 := NewLowBiased(RelativeEpsilon) @@ -133,7 +135,8 @@ func TestLowBiasedMerge(t *testing.T) { verifyLowPercsWithRelativeEpsilon(t, a, s2) } -func TestHighBiasedMerge(t *testing.T) { +// BrokenTestHighBiasedMerge is broken, see Merge doc comment. +func BrokenTestHighBiasedMerge(t *testing.T) { rand.Seed(42) s1 := NewHighBiased(RelativeEpsilon) s2 := NewHighBiased(RelativeEpsilon)