|
@@ -4,6 +4,8 @@ import ConfigParser
|
|
|
import sys
|
|
|
import os
|
|
|
import multiprocessing
|
|
|
+import itertools
|
|
|
+import copy
|
|
|
import subprocess
|
|
|
from pprint import pprint
|
|
|
from benchmark.benchmarker import Benchmarker
|
|
@@ -14,6 +16,30 @@ from setup.linux import setup_util
|
|
|
from colorama import init
|
|
|
init()
|
|
|
|
|
|
+class StoreSeqAction(argparse.Action):
|
|
|
+ '''Helper class for parsing a sequence from the command line'''
|
|
|
+ def __init__(self, option_strings, dest, nargs=None, **kwargs):
|
|
|
+ super(StoreSeqAction, self).__init__(option_strings, dest, type=str, **kwargs)
|
|
|
+ def __call__(self, parser, namespace, values, option_string=None):
|
|
|
+ setattr(namespace, self.dest, self.parse_seq(values))
|
|
|
+ def parse_seq(self, argument):
|
|
|
+ try:
|
|
|
+ return [int(argument)]
|
|
|
+ except ValueError:
|
|
|
+ pass
|
|
|
+ if ":" in argument: #
|
|
|
+ try:
|
|
|
+ (start,step,end) = argument.split(':')
|
|
|
+ except ValueError:
|
|
|
+ print "Invalid: %s" % argument
|
|
|
+ print "Requires start:step:end, e.g. 1:2:10"
|
|
|
+ raise
|
|
|
+ result = range(int(start), int(end), int(step))
|
|
|
+ else: # 1,2,3,7
|
|
|
+ result = argument.split(',')
|
|
|
+ return [abs(int(item)) for item in result]
|
|
|
+
|
|
|
+
|
|
|
###################################################################################################
|
|
|
# Main
|
|
|
###################################################################################################
|
|
@@ -81,9 +107,15 @@ def main(argv=None):
|
|
|
##########################################################
|
|
|
# Set up argument parser
|
|
|
##########################################################
|
|
|
- parser = argparse.ArgumentParser(description='Run the Framework Benchmarking test suite.',
|
|
|
+ parser = argparse.ArgumentParser(description="Install or run the Framework Benchmarks test suite.",
|
|
|
parents=[conf_parser],
|
|
|
- formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
|
|
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
|
+ epilog='''If an argument includes (type int-sequence), then it accepts integer lists in multiple forms.
|
|
|
+ Using a single number e.g. 5 will create a list [5]. Using commas will create a list containing those
|
|
|
+ values e.g. 1,3,6 creates [1, 3, 6]. Using three colon-separated numbers of start:step:end will create a
|
|
|
+ list, using the semantics of python's range function, e.g. 1:3:15 creates [1, 4, 7, 10, 13] while
|
|
|
+ 0:1:5 creates [0, 1, 2, 3, 4]
|
|
|
+ ''')
|
|
|
|
|
|
# SSH options
|
|
|
parser.add_argument('-s', '--server-host', default=serverHost, help='The application server.')
|