Added perf-testing
This commit is contained in:
parent
bd53a83058
commit
20afb205e3
19
caliGraph.py
19
caliGraph.py
@ -1331,6 +1331,7 @@ def cliInterface():
|
|||||||
parser.add_argument('--dark', action="store_true")
|
parser.add_argument('--dark', action="store_true")
|
||||||
parser.add_argument('--v3d', action="store_true")
|
parser.add_argument('--v3d', action="store_true")
|
||||||
parser.add_argument('--imgs', action="store_true")
|
parser.add_argument('--imgs', action="store_true")
|
||||||
|
parser.add_argument('--perf-test', action="store_true")
|
||||||
cmds = parser.add_subparsers(required=True, dest='cmd')
|
cmds = parser.add_subparsers(required=True, dest='cmd')
|
||||||
|
|
||||||
p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec'])
|
p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec'])
|
||||||
@ -1370,6 +1371,24 @@ def cliInterface():
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.perfTest:
|
||||||
|
perfTestCLI(args)
|
||||||
|
else:
|
||||||
|
mainCLI(args)
|
||||||
|
|
||||||
|
def perfTestCLI(args):
|
||||||
|
from pycallgraph import PyCallGraph
|
||||||
|
from pycallgraph import Config
|
||||||
|
from pycallgraph import GlobbingFilter
|
||||||
|
from pycallgraph.output import GraphvizOutput
|
||||||
|
config = Config()
|
||||||
|
config.trace_filter = GlobbingFilter(exclude=[
|
||||||
|
"pycallgraph.*",
|
||||||
|
])
|
||||||
|
with PyCallGraph(output=GraphvizOutput(output_file='perfTests/serve_httpd_' + str(int(time.time())) + '.png'), config=config):
|
||||||
|
mainCLI(args)
|
||||||
|
|
||||||
|
def mainCLI(args):
|
||||||
if args.cmd=="train":
|
if args.cmd=="train":
|
||||||
train(args.g, args.full)
|
train(args.g, args.full)
|
||||||
exit()
|
exit()
|
||||||
|
Loading…
Reference in New Issue
Block a user