output/hourly_spread.rb in wvanbergen-request-log-analyzer-0.2.2 vs output/hourly_spread.rb in wvanbergen-request-log-analyzer-0.3.0
- old
+ new
@@ -1,18 +1,18 @@
# Draws a graph containing the average amound of requests per hour per day
-if $summarizer.request_time_graph?
+if @summarizer.request_time_graph?
- max_request_graph = $summarizer.request_time_graph.max / $summarizer.duration
+ 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
+ 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
\ No newline at end of file