class BigBench::PostProcessor::Environment::Statistics

Calculates the default statistic values for a given attribute, like the duration, requests, etc.

Attributes

x[R]
y[R]

Public Class Methods

new(x, y, degree) click to toggle source
# File lib/bigbench/post_processor/environment.rb, line 244
def initialize x, y, degree
  @x, @y = x, y
end

Public Instance Methods

average() click to toggle source
Alias for: mean
max() click to toggle source

The maximum of the attribute

# File lib/bigbench/post_processor/environment.rb, line 249
def max
  @y.max
end
mean() click to toggle source

The mean or average of the attribute

# File lib/bigbench/post_processor/environment.rb, line 259
def mean
  @y.average
end
Also aliased as: average
min() click to toggle source

The minimum of the attribute

# File lib/bigbench/post_processor/environment.rb, line 254
def min
  @y.min
end
sd() click to toggle source
Alias for: standard_deviation
squared_deviation() click to toggle source

The squared deviation or variance of the attribute

# File lib/bigbench/post_processor/environment.rb, line 272
def squared_deviation
  u = mean
  @y.inject(0){ |result, element| result + (element - u) ** 2 }.to_f / @y.size.to_f
end
Also aliased as: variance
standard_deviation() click to toggle source

The standard deviation or sd of the attribute

# File lib/bigbench/post_processor/environment.rb, line 265
def standard_deviation
  u = mean
  @y.inject(0){ |result, element| result + (element - u).abs }.to_f / @y.size.to_f
end
Also aliased as: sd
variance() click to toggle source
Alias for: squared_deviation