Similar to Benchmark::Tms with the addition of standard deviation, mean, and total, for each of the data times.
tms = Benelux::Tms.new tms.real.sd # standard deviation tms.utime.mean # mean value tms.total.n # number of data points
Attributes
samples | [R] |
Public class methods
new
(tms=nil)
tms is a Benchmark::Tms object
[show source]
# File lib/benelux.rb, line 183 183: def initialize tms=nil 184: @samples = 0 185: members.each_with_index { |n, index| 186: next if n.to_s == 'label' 187: self.send("#{n}=", Stats::Calculator.new) 188: } 189: sample tms unless tms.nil? 190: end
Public instance methods
inspect
()
[show source]
# File lib/benelux.rb, line 208 208: def inspect 209: fields = members.collect { |f| 210: next unless Stats::Calculator === self.send(f) 211: '%s=%.2f@%.2f' % [f, self.send(f).mean, self.send(f).sd] 212: }.compact 213: args = [self.class.to_s, self.hexoid, samples, fields.join(' ')] 214: '#<%s:%s samples=%d %s>' % args 215: end
sample
(tms)
[show source]
# File lib/benelux.rb, line 191 191: def sample(tms) 192: @samples += 1 193: self.label ||= tms.label 194: members.each_with_index { |n, index| 195: next if n.to_s == 'label' 196: self.send(n).sample tms.send(n) || 0 197: } 198: end