specs/unit/ewma_spec.rb in drone-0.0.3 vs specs/unit/ewma_spec.rb in drone-1.0.1
- old
+ new
@@ -1,14 +1,17 @@
require File.expand_path('../../common', __FILE__)
require 'drone/utils/ewma'
describe 'EWMA' do
+ before do
+ Drone::init_drone
+ end
describe 'A 1min EWMA with a value of 3' do
before do
- @ewma = EWMA.one_minute_ewma
+ @ewma = Drone::EWMA.one_minute_ewma('id2')
@ewma.update(3)
@ewma.tick()
end
@@ -50,11 +53,11 @@
describe 'A 5min EWMA with a value of 3' do
before do
- @ewma = EWMA.five_minutes_ewma
+ @ewma = Drone::EWMA.five_minutes_ewma('id1')
@ewma.update(3)
@ewma.tick()
end
should "have a rate of 0.6 events/sec after the first tick" do
@@ -93,10 +96,10 @@
end
describe 'A 15min EWMA with a value of 3' do
before do
- @ewma = EWMA.fifteen_minutes_ewma
+ @ewma = Drone::EWMA.fifteen_minutes_ewma('id')
@ewma.update(3)
@ewma.tick()
end
should "have a rate of 0.6 events/sec after the first tick" do