34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/abcrunch/tester.rb', line 34
def self.log_result_summary(results)
AbCrunch::Logger.log :summary_title, "Summary"
AbCrunch::Logger.log :summary, "#{"Page".ljust(30, ' ')}#{"Response time".rjust(10, ' ')} #{"Concurrency".rjust(16, ' ')} #{"Queries/sec".rjust(12, ' ')}"
results.each do |result|
page_name = result[:page][:name].ljust(30, ' ')
base_response_time = sprintf("%.2f", result[:qps_result].avg_response_time).rjust(10, ' ')
max_concurrency = result[:qps_result].ab_options[:concurrency].to_s.rjust(16, ' ')
queries_per_second = sprintf("%.2f", result[:qps_result].queries_per_second).rjust(12, ' ')
if result[:passed]
AbCrunch::Logger.log :summary_passed, "#{page_name}#{base_response_time} #{max_concurrency} #{queries_per_second}"
else
AbCrunch::Logger.log :summary_failed, "#{page_name}#{base_response_time} #{max_concurrency} #{queries_per_second}"
end
end
AbCrunch::Logger.log :summary_title, "Legend"
AbCrunch::Logger.log :summary, "Response Time = Best average response time (ms) at max concurrency"
AbCrunch::Logger.log :summary, "Concurrency = Best concurrency where response time doesn't bust our performance threshold"
AbCrunch::Logger.log :summary, "Queries/sec = Queries per second at best concurrency"
results
end
|