Created
October 30, 2015 12:03
-
-
Save jtheuer/b7ca049f29f7c4e8698d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import fileinput | |
import re | |
import time | |
import subprocess, os, sys | |
def ctime(): | |
return int(time.time() * 1000) | |
p = subprocess.Popen(sys.argv[1:], stdout=subprocess.PIPE) | |
goals = [] | |
cur = None | |
for line in iter(p.stdout.readline, b''): | |
m = re.match('^\[INFO\] --- ([a-z0-9\:\.\-]+) \([a-z0-9\-]+\) \@ ([a-z0-9\:\.\-]+) ---', line) | |
if m: | |
cur = {'module': m.group(2), 'goal': m.group(1), 't': ctime()} | |
goals.append(cur) | |
goals.append({'module': 'finished', 'goal': '', 't': ctime()}) | |
first_ts = goals[0]['t'] | |
print("\n\n--- build results ---") | |
print("start\tduration\tmodule\tgoal") | |
for current, next in zip(goals, goals[1:]): | |
absolute = current['t'] - first_ts | |
diff = next['t'] - current['t'] | |
print("%d\t%d\t%s\t%s" % (absolute, diff, current['module'], current['goal'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run with
python profile_maven.py mvn clean install