Class: Apdex::CalculateFromLog

Inherits:
Object
  • Object
show all
Defined in:
lib/apdex/calculate_from_log.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ CalculateFromLog

Returns a new instance of CalculateFromLog.



6
7
8
# File 'lib/apdex/calculate_from_log.rb', line 6

def initialize(params={})
  @time_column = params[:time_column]
end

Instance Attribute Details

#time_columnObject (readonly)

Returns the value of attribute time_column.



4
5
6
# File 'lib/apdex/calculate_from_log.rb', line 4

def time_column
  @time_column
end

Instance Method Details

#call(threshold, input) ⇒ Object



20
21
22
23
# File 'lib/apdex/calculate_from_log.rb', line 20

def call(threshold, input)
  values = value_from_input(input)
  Calculate.new.call(threshold, values)
end


10
11
12
13
14
15
16
17
18
# File 'lib/apdex/calculate_from_log.rb', line 10

def print(threshold, input)
  values = call(threshold, input)
  [
    "Score: #{values[:score]}",
    "Satisfied: #{values[:satisfied]}",
    "Tolerating: #{values[:tolerating]}",
    "Frustrated: #{values[:frustrated]}",
  ].join("\n")
end