Sha256: 8b3ddde3048c4a3ada0aa347b1819fcbb84e3dcbc06a1e7cc5faed855a728252

Contents?: true

Size: 773 Bytes

Versions: 31

Compression:

Stored size: 773 Bytes

Contents

# Copyright (c) 2005 Zed A. Shaw 
# You can redistribute it and/or modify it under the same terms as Ruby.
#
# Additional work donated by contributors.  See http://mongrel.rubyforge.org/attributions.html 
# for more information.

require 'test/testhelp'

class StatsTest < Test::Unit::TestCase

  def test_sampling_speed
    out = StringIO.new

    s = Mongrel::Stats.new("test")
    t = Mongrel::Stats.new("time")

    100.times { s.sample(rand(20)); t.tick }

    s.dump("FIRST", out)
    t.dump("FIRST", out)
    
    old_mean = s.mean
    old_sd = s.sd

    s.reset
    t.reset
    100.times { s.sample(rand(30)); t.tick }
    
    s.dump("SECOND", out)
    t.dump("SECOND", out)
    assert_not_equal old_mean, s.mean
    assert_not_equal old_mean, s.sd    
  end

end

Version data entries

31 entries across 31 versions & 7 rubygems

Version Path
freels-mongrel-1.1.2 test/test_stats.rb
headius-mongrel-1.1.6.1 test/test_stats.rb
phurley-mongrel-1.1.6.1 test/test_stats.rb
mongrel-maglev--1.1.9.0.1 test/test_stats.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/test/test_stats.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/test/test_stats.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/test/test_stats.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/test/test_stats.rb
mongrel-1.2.0.pre2-x86-mswin32 test/test_stats.rb
mongrel-1.2.0.pre2-x86-mingw32 test/test_stats.rb
mongrel-1.2.0.pre2 test/test_stats.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/test/test_stats.rb
sho-mongrel-1.1.5 test/test_stats.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/test/test_stats.rb
mongrel-1.0.3 test/test_stats.rb
mongrel-1.0.4 test/test_stats.rb
mongrel-1.0.2 test/test_stats.rb
mongrel-1.1.2 test/test_stats.rb
mongrel-1.1.3 test/test_stats.rb
mongrel-1.1.1 test/test_stats.rb