1 # Copyright (c) 2005 Zed A. Shaw
2 # You can redistribute it and/or modify it under the same terms as Ruby.
4 # Additional work donated by contributors. See http://mongrel.rubyforge.org/attributions.html
5 # for more information.
7 require 'test/testhelp'
9 class StatsTest < Test::Unit::TestCase
11 def test_sampling_speed
14 s = Mongrel::Stats.new("test")
15 t = Mongrel::Stats.new("time")
17 100.times { s.sample(rand(20)); t.tick }
27 100.times { s.sample(rand(30)); t.tick }
31 assert_not_equal old_mean, s.mean
32 assert_not_equal old_mean, s.sd