Skip to content
This repository has been archived by the owner. It is now read-only.
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Statistics/Metric Dashboard for your product


  1. Redis

Up and Running

  1. Fork & Clone this repo
  2. pip install -r requirements.txt (Hopefully, in your virtualenv)
  3. Ensure redis is running
  4. Run ./ seed_db to create your ORM objects
  5. ./manage runserver to start server
  6. ./ run_huey to start the worker (that periodically fetches your metric data and stores them in DB). Also please note that you need to manually stop and start huey whenever there is a change in your data fetcher code

Adding new metrics

Lets say you need to add new metric called foo metric. You need to do following (detailed explanations are below):

  1. Update statboard/ with variable METRIC_FOO='foo'
  2. Run ./ seed_db to create your ORM objects (You need to run this everytime you add a new metric)
  3. Create a statboard/core/metrics/ which should declare def fetch(metric): function
  4. Create a statboard/core/templates/foo.html to render your data

Updating Settings

If you need to add a new metric, first add a variable called METRIC_<YOUR_METRIC_IN_CAPS>='<your_metric>' in your file. This will be used by seed_db command to create a new Metric object in your DB & to create a new URL /metric/<your_metric> automatically. Just be sure that it should start with the exact METRIC_ prefix for this to work.

Seed DB

Run ./ seed_db. This will create the Metric object for you. You can then use and metric.set_data(<json_dict>) to get and set your data data respectively.

Fetching Metrics

You should create a file statboard/core/metrics/<your_metric>.py. Your file will look something like this:

def fetch(metric):
	This fetch function will be automatically called by our worker
	You will get the `metric` orm object
	<json_dict> = some_logic_that_fetches_your_data()

If you need any sensitive keys, make sure you put them in environment variable and access it from there. Please make sure that <json_dict> is a simple python dict with primitive data.

Rendering Your Metrics

Create a statboard/core/templates/<your_metric>.html file which ALWAYS extends base.html and looks something like this:

{% extends 'base.html' %}

{% block title %}
Your Metric
{% endblock %}

{% block content %}

{% for name in %}
{% endfor %}

{% endblock %}

Your metric ORM object will automatically be available in your template. Whatever <json_dict> data that you set in the previous step will be available through in your templates.


Statistics/Metric Dashboard for your product




No releases published


No packages published