Class: ApiTester::ResponseTimeReport
- Inherits:
-
Object
- Object
- ApiTester::ResponseTimeReport
- Defined in:
- lib/api-tester/reporter/response_time_report.rb
Overview
Report used for when response took too long
Instance Attribute Summary collapse
-
#actual_time ⇒ Object
Returns the value of attribute actual_time.
-
#description ⇒ Object
Returns the value of attribute description.
-
#max_time ⇒ Object
Returns the value of attribute max_time.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#url ⇒ Object
Returns the value of attribute url.
-
#verb ⇒ Object
Returns the value of attribute verb.
Instance Method Summary collapse
-
#initialize(url:, verb:, payload:, max_time:, actual_time:, description:) ⇒ ResponseTimeReport
constructor
A new instance of ResponseTimeReport.
- #print ⇒ Object
Constructor Details
#initialize(url:, verb:, payload:, max_time:, actual_time:, description:) ⇒ ResponseTimeReport
Returns a new instance of ResponseTimeReport.
8 9 10 11 12 13 14 15 |
# File 'lib/api-tester/reporter/response_time_report.rb', line 8 def initialize(url:, verb:, payload:, max_time:, actual_time:, description:) self.url = url self.verb = verb self.payload = payload self.max_time = max_time self.actual_time = actual_time self.description = description end |
Instance Attribute Details
#actual_time ⇒ Object
Returns the value of attribute actual_time.
6 7 8 |
# File 'lib/api-tester/reporter/response_time_report.rb', line 6 def actual_time @actual_time end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/api-tester/reporter/response_time_report.rb', line 6 def description @description end |
#max_time ⇒ Object
Returns the value of attribute max_time.
6 7 8 |
# File 'lib/api-tester/reporter/response_time_report.rb', line 6 def max_time @max_time end |
#payload ⇒ Object
Returns the value of attribute payload.
6 7 8 |
# File 'lib/api-tester/reporter/response_time_report.rb', line 6 def payload @payload end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/api-tester/reporter/response_time_report.rb', line 6 def url @url end |
#verb ⇒ Object
Returns the value of attribute verb.
6 7 8 |
# File 'lib/api-tester/reporter/response_time_report.rb', line 6 def verb @verb end |
Instance Method Details
#print ⇒ Object
17 18 19 20 21 22 |
# File 'lib/api-tester/reporter/response_time_report.rb', line 17 def print puts "#{description}:" puts " #{verb} #{url} took #{actual_time}ms, the max time is #{max_time}ms:" puts ' Payload:' puts " #{payload}" end |