Method: Hitimes::Stats#stddev

Defined in:
lib/hitimes/stats.rb

#stddevObject

call-seq:

stat.stddev -> Float

Return the standard deviation of all the values that have passed through the Stats object. The standard deviation has no meaning unless the count is > 1, therefore if the current stat.count is < 1 then 0.0 will be returned;



104
105
106
107
108
# File 'lib/hitimes/stats.rb', line 104

def stddev
  return 0.0 unless @count > 1

  Math.sqrt((@sumsq - ((@sum * @sum) / @count)) / (@count - 1))
end