We need to find a good place to store page metrics as a rails page loads. It'll include stats, initially how many times certain slow methods are used. We're using a class variable on ApplicationController at the moment but that seems like code smell. Is there a better way to do this?
class ApplicationController < ActionController::Base
cattr_accessor :page_stats
def increment_slow_stuff()
@@page_stats ||= {}
@@page_stats[:slow_stuff] ||= 0
@@page_stats[:slow_stuff] += 1
end
def slow_method()
increment_slow_stuff()
...
end
end