output/timespan.rb in wvanbergen-request-log-analyzer-0.1.2 vs output/timespan.rb in wvanbergen-request-log-analyzer-0.2.2
- old
+ new
@@ -4,6 +4,13 @@
if $summarizer.has_timestamps?
puts "Timestamp first request: #{$summarizer.first_request_at}"
puts "Timestamp last request: #{$summarizer.last_request_at}"
puts "Total time analyzed: #{$summarizer.duration} days"
-end
+end
+
+methods_print_array = []
+methods_request_count = $summarizer.methods.inject(0) { |subtotal, (k, v)| subtotal + v }
+$summarizer.methods.each do |key, value|
+ methods_print_array << "%s (%0.01f%%)" % [key, green((value * 100) / methods_request_count.to_f)]
+end
+puts 'Methods: ' + methods_print_array.join(', ') + '.'
\ No newline at end of file