Analytics

This is for #108.

First, make sure you have Redis installed. On Mac, you can use Homebrew: `brew install redis`.

And run:

1. `bundle install`
2. `foreman start`

Then open the app in one browser and log in as a student, go to the Predictor. Start setting some predictions for various assignments.

Now, open a new browser tab and visit http://localhost:4242/gradecraft#gauge/events_per_minute and you can see the events being logged.

Right now, the graphs are just showing the number of events happening, but the events are actually logging who the user is and what the user is selecting as well. If you visit http://localhost:4242/gradecraft#active_users, you can see the user info for the sessions. The app in this branch is logging "log-in, log-out, avatar_set (happens at log-in, this will put the users' avatars in the analytics), and predictor_set events.

Now the Fnordmetric admin interface is useful as a proof of concept, but we'll actually be showing statistics inside the Gradecraft interface. So now, open the app in another browser and log in as dumbledore, and go to Analytics => Events (in the sidebar).

You'll see the events logged in real-time there for the last 10 minutes. It'll actually update every 10 seconds without reloading the page.

If you don't want to sit around making the predictor events happen, there's a rake task that will simulate a bunch of events being logged constantly until you stop the script. Just run:

```
bundle exec rake fnordmetric:populate
```

Also, I should note that there is a weird port access conflict between Fnordmetric and the CrashPlan backup engine if you have that running in the background (even if it's not currently backing up). In order to fully stop CrashPlan, [do this](http://support.crashplan.com/doku.php/recipe/stop_and_start_engine).