Class: ResponseTimeChecker
- Defined in:
- lib/plugins/plug05_response_time_checker.rb
Instance Method Summary collapse
-
#check ⇒ Object
checks if the request response cycle exceeded the maximum expected time.
Methods inherited from Checker
available_plugins, #initialize
Constructor Details
This class inherits a constructor from Checker
Instance Method Details
#check ⇒ Object
checks if the request response cycle exceeded the maximum expected time
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/plugins/plug05_response_time_checker.rb', line 4 def check result = Result.new(@testcase, @response) begin if not (@testcase.response_expectation['runtime'].nil? || @response.runtime.to_f <= @testcase.response_expectation['runtime'].to_f) result.succeeded = false result. = " expected request->response runtime was #{@testcase.response_expectation['runtime']}, real runtime was #{@response.runtime}" end rescue Exception => e result.succeeded = false result. = " unexpected error while parsing testcase/response. Check your testcase format!" result. = "\n\nException occured: #{e}" end result end |