From 4e7e1d2ffea89950ae516a19997765daccf92664 Mon Sep 17 00:00:00 2001 From: Mark Beierl Date: Wed, 11 May 2016 15:38:26 -0600 Subject: Max test duration Add a maximum time limit for any one given test so that silly mistakes like block size 512, queue depth 1 does not end up running for 2 days JIRA: STORPERF-53 Change-Id: I1f3e5046e1dd346fc5b28a7b935df2ee9aa6ba3d Signed-off-by: Mark Beierl --- rest_server.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'rest_server.py') diff --git a/rest_server.py b/rest_server.py index b628a7e..b7d32d9 100644 --- a/rest_server.py +++ b/rest_server.py @@ -220,6 +220,7 @@ class WorkloadModel: 'target': fields.String, 'nossd': fields.String, 'nowarm': fields.String, + 'deadline': fields.Integer, 'workload': fields.String, 'queue_depths': fields.String, 'block_sizes': fields.String @@ -291,13 +292,22 @@ class Job(Resource): parameters=[ { "name": "body", - "description": 'Start execution of a workload with the ' - 'following parameters: "target": The target device to ' - 'profile", "nossd": Do not fill the target with random ' - 'data prior to running the test, "nowarm": Do not ' - 'refill the target with data ' - 'prior to running any further tests, "workload":if specified, ' - 'the workload to run. Defaults to all.', + "description": """Start execution of a workload with the + following parameters: + + "target": The target device to profile", + + "deadline": if specified, the maximum duration in minutes + for any single test iteration. + + "nossd": Do not fill the target with random + data prior to running the test, + + "nowarm": Do not refill the target with data + prior to running any further tests, + + "workload":if specified, the workload to run. Defaults to all. + """, "required": True, "type": "WorkloadModel", "paramType": "body" @@ -324,6 +334,8 @@ class Job(Resource): try: if ('target' in request.json): storperf.filename = request.json['target'] + if ('deadline' in request.json): + storperf.deadline = request.json['deadline'] if ('nossd' in request.json): storperf.precondition = False if ('nowarm' in request.json): -- cgit 1.2.3-korg