Sha256: c3243ae6b1a67edd7e5f02d1c41fb419dc78e5d59baf7da764c27c86530ac3fa

Contents?: true

Size: 780 Bytes

Versions: 17

Compression:

Stored size: 780 Bytes

Contents

class ResponseTimeChecker < Checker

  # checks if the request response cycle exceeded the maximum expected time
  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.error_message = " expected request->response runtime was #{@testcase.response_expectation['runtime']}, real runtime was #{@response.runtime}"
      end
     rescue Exception => e
       result.succeeded = false
       result.error_message = " unexpected error while parsing testcase/response. Check your testcase format!"
       result.error_message = "\n\nException occured: #{e}"
     end
    result
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
apirunner-0.5.5 lib/plugins/plug05_response_time_checker.rb
apirunner-0.5.0 lib/plugins/plug05_response_time_checker.rb
apirunner-0.4.10 lib/plugins/plug05_response_time_checker.rb
apirunner-0.4.9 lib/plugins/plug05_response_time_checker.rb
apirunner-0.4.8 lib/plugins/plug05_response_time_checker.rb
apirunner-0.4.7 lib/plugins/plug05_response_time_checker.rb
apirunner-0.4.6 lib/plugins/plug05_response_time_checker.rb
apirunner-0.4.5 lib/plugins/plug05_response_time_checker.rb
apirunner-0.4.4 lib/plugins/plug05_response_time_checker.rb
apirunner-0.4.3 lib/plugins/plug05_response_time_checker.rb
apirunner-0.4.2 lib/plugins/plug05_response_time_checker.rb
apirunner-0.4.1 lib/plugins/plug05_response_time_checker.rb
apirunner-0.4.0 lib/plugins/plug05_response_time_checker.rb
apirunner-0.3.10 lib/plugins/plug05_response_time_checker.rb
apirunner-0.3.9 lib/plugins/plug05_response_time_checker.rb
apirunner-0.3.8 lib/plugins/plug05_response_time_checker.rb
apirunner-0.3.7 lib/plugins/plug05_response_time_checker.rb