Skip to content

Commit

Permalink
Test for rcrowley#104
Browse files Browse the repository at this point in the history
  • Loading branch information
rcrowley committed May 26, 2015
1 parent 49469ac commit 670402e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sample_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,17 @@ func TestExpDecaySampleNanosecondRegression(t *testing.T) {
}
}

func TestExpDecaySampleRescale(t *testing.T) {
s := NewExpDecaySample(2, 0.001).(*ExpDecaySample)
s.update(time.Now(), 1)
s.update(time.Now().Add(time.Hour+time.Microsecond), 1)
for _, v := range s.values.Values() {
if v.k == 0.0 {
t.Fatal("v.k == 0.0")
}
}
}

func TestExpDecaySampleSnapshot(t *testing.T) {
now := time.Now()
rand.Seed(1)
Expand Down

0 comments on commit 670402e

Please sign in to comment.