Tracking latency in rails

I’ve built a web-app and i want to start tracking request latencies so
i can see how the app handles more and more people using it. However,
not sure how this can be done.

I’d like to be able to log the start-time when the request comes in and
log the end time as the response gets sent out. Do i need to bookend
action with a before-filter and after-filter? Also, how could i track
numbers independent of caching? From my understanding, if i use rails
caching, it will not go into the code if the page exists in the cache.

I know that if i use caches_action, then the filters will be run,
its important that i can log the times as close to the use as possible.
think this means either just before it hits dispatch.fcgi or just after.
For certain actions i’d also like to log request information (referer
IP address, etc). Does this mean i always have to go into the code and
serve files straight from disk?

If anyone has implemented a good system for tracking real-time
i’d greatly appreciate hearing about it.

Thanks in advance.