# 3. wait few days (weeks) to gather data :) # 4. display results by this rake task sorted from most frequent action to least frequent action # rake action:show_frequency # 5. The rule 80/20 says - users are doing 20% of actions in 80% of time # -> increase performance, improve user experience, ... of these actions namespace :action do desc "This tasks shows freuquency of requests" task show_frequency: :environment do sum = Action.sum(:count) Action.all.order('count desc').each_with_index do |a, index| p "#{index}, #{a.controller}##{a.action_name}, " + ((a.count.to_f / sum.to_f) * 100).round(2).to_s + ", " + a.count.to_s end end end