Skip to content

Instantly share code, notes, and snippets.

@padenot
Created May 5, 2014 21:56
Show Gist options
  • Save padenot/b82eac91b24519ad03e9 to your computer and use it in GitHub Desktop.
Save padenot/b82eac91b24519ad03e9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import matplotlib.pyplot as plt
import pylab as pl
import numpy as np
import os
import sys
data = {}
for i in sys.stdin.readlines():
(k, v) = i.split(" ")
data[os.path.basename(k)] = int(v)
figure = plt.figure()
ind = np.arange(len(data.values()))
plt.bar(ind, data.values())
plt.xticks(ind + 0.5, data.keys(), rotation=90)
figure.set_size_inches(40,30)
figure.subplots_adjust(bottom=0.2)
figure.savefig("out.pdf",format="pdf")
#/bin/sh
[ $# -ne 1 ] && echo "Usage:\n\t$0 mochitest-output" && exit 1
grep "finished in" $1 | sed 's/^ //' | cut -d ' ' -f 6,10 | sed 's/ms$//' | python grapher.py
echo "graph written to out.pdf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment