This is a summary of my experiences and a mini-guide regarding the deploying and usage of a Cube server and Geckoboard to track statistics at Responsa.
I’ll explain how I deployed Cube to a VPS in the cloud and how I’ve integrated it in Responsa. I’ll also talk about Geckoboard and how we used it to draw graphs based on metrics extracted from Cube, but first here’s a brief description of Cube and Geckoboard.
Cube is a system for collecting timestamped events and deriving metrics. By collecting events rather than metrics, Cube lets you compute aggregate statistics post hoc. It also enables richer analysis, such as quantiles and histograms of arbitrary event sets.
Geckoboard is a service for drawing graphs and statistics and organizing them in widgets that populate dashboards.
To deploy the Cube server I’ve chosen Linode, a service that gives you an empty Ubuntu Server virtual machine in the cloud. After the creation of the machine you can just ssh inside and start installing your server.
Since chef uses ruby we need to install it first in our machine so just run these commands to get some basic stuff:
1 2 3 4 5 6 7 8
Then you can install Cube with:
Now all you need to do is to download the cookbooks and run chef:
1 2 3
And your Cube server should be up and running ready to track events!
For example if we want to track a request we can write:
Let’s say we want the daily requests on our website in this month we can write:
1 2 3 4 5 6 7
daily_requests will be an Hash containing the array of times and the array of corresponding values
Geckoboard needs an endpoint in your server to poll in order to draw the data. To ease the creation of these endpoints I’ve improved and used the chameleon gem. Just add it to your gemfile
then run bundle to install it
Let’s draw the daily_requests now. Create a line widget graph
and use your daily_requests hash to populate it
1 2 3 4 5 6 7 8 9 10 11
Congrats! You are now tracking statistics in the coolest way possible ;)