Class: RakeGatling::ResultMonitor

Inherits:
Object
  • Object
show all
Defined in:
lib/src/ResultMonitor.rb

Constant Summary collapse

ERROR_MESSAGE =
"Gatling results contain one or more KOs"

Instance Method Summary collapse

Constructor Details

#initialize(results_repository) ⇒ ResultMonitor

Returns a new instance of ResultMonitor.



5
6
7
# File 'lib/src/ResultMonitor.rb', line 5

def initialize(results_repository)
	@results_repository = results_repository
end

Instance Method Details

#check_for_failuresObject



9
10
11
12
13
14
15
16
# File 'lib/src/ResultMonitor.rb', line 9

def check_for_failures
	results = @results_repository.get
	results.keys.each do |record_key|
		record = results[record_key]
		ko = record['ko']
		raise KOsError, ERROR_MESSAGE if !ko.nil? && ko > 0
	end
end