Class: Apdex::CalculateFromLog
- Inherits:
-
Object
- Object
- Apdex::CalculateFromLog
- Defined in:
- lib/apdex/calculate_from_log.rb
Overview
Instance Attribute Summary collapse
-
#time_column ⇒ Object
readonly
Returns the value of attribute time_column.
Instance Method Summary collapse
- #call(threshold, input) ⇒ Object
-
#initialize(params = {}) ⇒ CalculateFromLog
constructor
A new instance of CalculateFromLog.
- #print(threshold, input) ⇒ Object
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_column ⇒ Object (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 24 25 |
# File 'lib/apdex/calculate_from_log.rb', line 20 def call(threshold, input) values = value_from_input(input) output = categorize_values(values, threshold) output[:score] = calculate_apdex(output) output end |
#print(threshold, input) ⇒ Object
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 |