Priit
Priit

Reputation: 5248

Best way to collect Rails application usage statistics

I have a Rails application where users can set up their domains and publish content onto them. I need to collect public traffic statistics such as pageview count etc. One good example of this feature is flickr usage statistics i can see as a customer.

The question is what is the best way to collect usage information. Should it be done by parsing log files or should it be collected and stored in database at runtime? Is there any tool or Rails plugin that already provides this?

This solution should scale well, even with thousands of domains and millions of pageviews in month.

Upvotes: 6

Views: 4836

Answers (4)

user52804
user52804

Reputation: 319

It depends on exactly what you're trying to log.

I've started to use http://github.com/smtlaissezfaire/enhanced_query_analyzer/tree/master in a beta-production system to log queries. You could certainly do something similar to log page views with a before filter in application.rb

If you need or want to use a database, don't want to share your information with google, and are using mysql, I'd suggest looking into the archive storage engine

Upvotes: 2

Bill
Bill

Reputation: 1563

Check with your host. A few of them provide Urchin stats by default.

Other than that most people use Google Analytics. If you need extremely fine grained information you can try some post processing on your production.log with tools like this one. If you do your post-processing on a scheduler ( like cron ) then you should not need to worry about performance or scaling too much.

Upvotes: 1

Steve Losh
Steve Losh

Reputation: 19892

The easiest solution is probably just to buy Mint or use Google Analytics.

Upvotes: 0

Matt Darby
Matt Darby

Reputation: 6324

Google Analytics is probably your best bet...

Upvotes: 5

Related Questions