Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
updated to allow users to specify killing controllers as part of the …
Browse files Browse the repository at this point in the history
…workload
  • Loading branch information
pdmars committed May 14, 2011
1 parent 554f33f commit d53c30d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/generate-workload-definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ def parse_options():
'may be a comma separated list, however, ' + \
'spaces are not allowed. The length of the list ' + \
'must match the list provided for --kill-seconds.')
parser.add_option('--kill-controller', dest='killController', \
help='Seconds to wait before killing a ' + \
'This may be a comma separated list.')
parser.add_option('--submit-seconds', dest='submitSeconds', \
help='Seconds to wait before submitting tasks. This ' + \
'may be a comma separated list, however, ' + \
Expand Down Expand Up @@ -77,12 +80,19 @@ def parse_options():

def write_workload(killSeconds, \
killCounts, \
killController, \
submitSeconds, \
submitCounts, \
submitSleep, \
firstBatchID):
controllerLine = 'KILL_CONTROLLER %s 1\n'
killLine = 'KILL %s %s\n'
submitLine = 'SUBMIT %s %s %s %s\n'
if killController != None:
cList = killController.split(',')
listLen = len(cList)
for i in range(listLen):
sys.stdout.write(controllerLine % cList[i])
if killSeconds != None and killCounts != None:
ksList = killSeconds.split(',')
kcList = killCounts.split(',')
Expand Down Expand Up @@ -113,6 +123,7 @@ def main():
return 1
write_workload(options.killSeconds, \
options.killCounts, \
options.killController, \
options.submitSeconds, \
options.submitCounts, \
options.submitSleep, \
Expand Down

0 comments on commit d53c30d

Please sign in to comment.