Sha256: bd8899cb6445796170720be86559309bda43f620091fa2ad8b9b3856f342df2b
Contents?: true
Size: 987 Bytes
Versions: 4
Compression:
Stored size: 987 Bytes
Contents
# Draws a graph containing the average amound of requests per hour per day if @summarizer.request_time_graph? max_request_graph = @summarizer.request_time_graph.max / @summarizer.duration deviation = max_request_graph / 20 deviation = 1 if deviation == 0 color_cutoff = 15 puts puts "Requests graph - average per day per hour" puts green("========================================================================") (0..23).each do |a| requests = @summarizer.request_time_graph[a] / @summarizer.duration display_chars = requests / deviation if display_chars >= color_cutoff display_chars_string = green(' ' * color_cutoff) + red(' ' * (display_chars - color_cutoff)) else display_chars_string = green(' ' * display_chars) end puts "#{a.to_s.rjust(10)}:00 - #{('[' + requests.to_s + ' req.]').ljust(15)} : #{display_chars_string}" end else puts puts "Hourly spread not available" end
Version data entries
4 entries across 4 versions & 1 rubygems