-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compute the grid5k timeout based on repair timeout (#16)
- Loading branch information
1 parent
e2f3ff0
commit a961df6
Showing
3 changed files
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
def getGridTime(timeout, overhead = 0.33): | ||
''' computes the timeout of the grid based on the timeout (from the tool) received as parameter. | ||
Moreover it adds an overhead with is a percentage of the original timeout''' | ||
timetool = int(timeout) | ||
timetooloverhead = timetool + (timetool * overhead) | ||
hr_st = str(int(timetooloverhead // 60)) | ||
minutes = int(timetooloverhead % 60) | ||
mt_st = str(minutes) if minutes >=10 else ("0" + str(minutes)) | ||
timestring = hr_st + ":" + mt_st | ||
return timestring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters