benelux 0.5.11 → 0.5.12

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.txt CHANGED
@@ -1,5 +1,13 @@
1
1
  BENELUX, CHANGES
2
2
 
3
+ #### 0.5.12 (2010-03-19) ##############################
4
+
5
+ * CHANGE: When merging Benelux::Stats::Calculator objects into one that has 0 samples,
6
+ use the values of min and max rather than averages for all.
7
+ * CHANGE: Benelux::Stats::Calculator#mean is now an alias for #avg since
8
+ we don't actual return the mean anyway (we don't keep the sample values)
9
+
10
+
3
11
  #### 0.5.11 (2010-03-15) ##############################
4
12
 
5
13
  * FIXED: Don't reset packed_methods!
data/benelux.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = "benelux"
3
3
  s.rubyforge_project = 'benelux'
4
- s.version = "0.5.11"
4
+ s.version = "0.5.12"
5
5
  s.summary = "Benelux: A mad way to time Ruby codes"
6
6
  s.description = s.summary
7
7
  s.author = "Delano Mandelbaum"
data/lib/benelux.rb CHANGED
@@ -4,7 +4,7 @@ require 'thwait'
4
4
  require 'selectable'
5
5
 
6
6
  module Benelux
7
- VERSION = "0.5.11"
7
+ VERSION = "0.5.12"
8
8
  NOTSUPPORTED = [Class, Object, Kernel]
9
9
 
10
10
  class BeneluxError < RuntimeError; end
data/lib/benelux/stats.rb CHANGED
@@ -150,7 +150,7 @@ module Benelux
150
150
 
151
151
  def merge!(other)
152
152
  if @sum == 0
153
- @min = @max = other.mean
153
+ @min, @max = other.min, other.max
154
154
  else
155
155
  @min = other.min if other.min < @min
156
156
  @max = other.max if other.max > @max
@@ -202,9 +202,13 @@ module Benelux
202
202
  def to_f; mean.to_f; end
203
203
  def to_i; mean.to_i; end
204
204
 
205
+ # NOTE: This is an alias for average. We don't store values
206
+ # so we can't return the actual mean
207
+ def mean; avg() end
208
+ def average; avg() end
205
209
  # Calculates and returns the mean for the data passed so far.
206
- def mean; return 0.0 unless @n > 0; @sum / @n; end
207
-
210
+ def avg; return 0.0 unless @n > 0; @sum / @n; end
211
+
208
212
  # Calculates the standard deviation of the data so far.
209
213
  def sd
210
214
  return 0.0 if @n <= 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benelux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.11
4
+ version: 0.5.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-15 00:00:00 -04:00
12
+ date: 2010-03-19 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15