Add monthly visitors functionality #1
10
main.rb
10
main.rb
|
@ -150,18 +150,10 @@ top_client_errors.each do |ip, count|
|
|||
puts "#{ip}: #{count} errors"
|
||||
end
|
||||
|
||||
top_monthly_visits = monthly_visits.sort_by { |_ip, dates| -dates.values.sum }.first(5)
|
||||
top_monthly_visits.each do |ip, dates|
|
||||
puts "IP #{ip} had the most visits in the following months:"
|
||||
dates.each do |date, count|
|
||||
puts " #{date}: #{count} visits"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
monthly_visits.each do |ip, visits|
|
||||
puts "IP #{ip} had the following visits:"
|
||||
visits.each do |date, count|
|
||||
puts " #{date}: #{count} visits"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue