Skip to content

ENH: add git names to test_perf.py #4392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions vb_suite/test_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@
HEAD_COL="head[ms]"
BASE_COL="base[ms]"


class RevParseAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
import subprocess
cmd = 'git rev-parse {0}'.format(values)
rev_parse = subprocess.check_output(cmd, shell=True)
setattr(namespace, self.dest, rev_parse.strip())


parser = argparse.ArgumentParser(description='Use vbench to measure and compare the performance of commits.')
parser.add_argument('-H', '--head',
help='Execute vbenches using the currently checked out copy.',
Expand All @@ -53,10 +62,10 @@
default=False)
parser.add_argument('-b', '--base-commit',
help='The commit serving as performance baseline ',
type=str)
type=str, action=RevParseAction)
parser.add_argument('-t', '--target-commit',
help='The commit to compare against the baseline (default: HEAD).',
type=str)
type=str, action=RevParseAction)
parser.add_argument('-m', '--min-duration',
help='Minimum duration (in ms) of baseline test for inclusion in report (default: %.3f).' % DEFAULT_MIN_DURATION,
type=float,
Expand Down