Building a metrics dashboard with raspberry pi
We’re pretty serious about our metrics here at Exotel, and recently I built a key performance metrics dashboard for tracking our marketing metrics. We believe in the line “You can’t improve what you don’t measure”. Listed below are the ingredients you need to set it up yourself:
We used the Raspberry Pi B edition with 512MB of RAM, HDMI out, 2 USB ports, 1 ethernet port, and a micro USB power port. Lots of options on eBay India for raspberry pi. It comes to around Rs. 5000, fully loaded.
Some tips for buying a raspberry pi:
- Buy a 4GB memory card with raspbian pre-loaded
- Buy a case for the raspberry pi so it doesn’t accumulate dust
- Consider if you need a wireless adapter as it’ll use more power than using the ethernet port
- You will need a micro-usb power cable, some ethernet cables, mouse and keyboard if you want to work on the raspi
Some tips for running the raspberry pi:
1) The screen might keep turning off and the annoying screensaver will come up every 15 mins. If you use lightdm, you can edit the config file /etc/lightdm/lightdm.conf and change the X server settings like below
xserver-command = X -s 0 dpms
2) If you want to setup the wireless router for raspberry pi, look at this article from GoCardless
3)To run the raspberry pi efficiently by turning off screen when people aren’t in office, etc, take a look at this gist for some linux setup commands
Buying a TV to display the metrics was one of the best decisions we ever made. It makes sure the metrics are open to everyone, also achieves the in-your-face effect and makes everyone think about the metrics and take decisions based on them.
- The make of the TV doesn’t matter as long as you stick to the major ones as the price is pretty much the same across all major manufacturers. You might get the TVs for cheap if you import some Chinese model, but support can be an issue with those kind of TVs
- Decide how big you want the TV to be, and figure out the logistics of putting it up in your office. TVs lesser than size 40 inches can be easily accommodated in a visible corner and be wall mounted
- Decide whether you want to go for an LCD or LED TV – it’s a how-well-you-want-it-to-look decision, and LED is a little more clearer than LCD, and LCDs come for cheaper. Power consumption is more for LCDs, and they will have a lot of legacy support for connectivity options like VGA.
- Wall mounting can be a flat one or a swivel mount. Swivel mount is cool as you can move the TV around on the wall to connect or disconnect wires. Check out the Wall Mount Kits on Ebay.in
I investigated various ways in which you could build a metrics dashboard. I’m listing some of the alternatives I considered so you can see if it makes sense for your startup.
All the hosted ones were very costly given the dollar rate and our requirements were more niche and we needed more control over the software we run in this case. So, we had to opt for an open source dashboard software.
- Shiny, by RStudio
- Dashing, by Shopify
Advantages: Realtime creation of widgets.
Fnordmetric Fnordmetric is a custom real time dashboard system in Ruby on Rails. It does both data collection and rendering of data using a Redis store. It’s very versatile in the handling of time-series graphs mostly and there are a lot of client libraries for integration in to your favorite language. Realtime is done using websockets again.
Advantages: Really easy to visualize time-series data
Cons: Very less documentation, sluggish feedback on bugs
Advantages: Easy to manipulate and see the effects of filters
Disadvantages: It uses R, and we weren’t that adventurous. 🙂
Dashing Dashing is very similar to Dashku, and is very appealing visually due to the Windows Metro look. But the widgets have to defined at the time of creation. It doesn’t use any data store, and uses Server Sent Events to achieve real time. We made some mods to Dashing whereby we backed the data using a REST endpoint. Updates to the dashboard are being done by scripts written in PHP.
Advantages: Very light-weight as there’s no data store, beautiful dashboards, can be run on Heroku!
Disadvantages: No data store, needs some work before it can be run on Heroku.
- Host it on heroku. No hassle, and can be loaded by anyone with an internet connection. Make sure to protect your metrics with either basic auth or google OAuth (options available in dashing). Use our remote_backup branch to make sure you backup the latest state of the dashboard. Instructions for setup are in the repository. Remote backup was Ruby God Akash Manohar‘s idea.
Here’s how it looks at the end:
Do feel free to reach out to us in case of any questions!