Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: tools/android/loading/cloud/frontend/clovis_frontend.py

Issue 2037373003: tools/android/loading Fix precision and formatting issues in frontend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/cloud/frontend/clovis_frontend.py
diff --git a/tools/android/loading/cloud/frontend/clovis_frontend.py b/tools/android/loading/cloud/frontend/clovis_frontend.py
index ecb19eee46d86dffb43c7864f1eaac4a38216ca4..99a2257ee1a493904bc4244a52c5d740dd47b1e6 100644
--- a/tools/android/loading/cloud/frontend/clovis_frontend.py
+++ b/tools/android/loading/cloud/frontend/clovis_frontend.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import logging
+import math
import os
import sys
import time
@@ -358,8 +359,8 @@ def StartFromJsonString(http_body_str):
# Compute the number of required instances if not specified.
if not task.BackendParams().get('instance_count'):
target_parallel_duration_s = 1800.0 # 30 minutes.
- task.BackendParams()['instance_count'] = int(
- sequential_duration_s / target_parallel_duration_s + 0.5) # Rounded up.
+ task.BackendParams()['instance_count'] = math.ceil(
+ sequential_duration_s / target_parallel_duration_s)
# Check the instance quotas.
clovis_logger.info(
@@ -382,7 +383,7 @@ def StartFromJsonString(http_body_str):
# Timeout is at least 1 hour.
task.BackendParams()['timeout_hours'] = max(1, 5 * expected_duration_h)
clovis_logger.info(
- 'Timeout delay: %i hours. ' % task.BackendParams()['timeout_hours'])
+ 'Timeout delay: %.1f hours. ' % task.BackendParams()['timeout_hours'])
if not EnqueueTasks(sub_tasks, task_tag):
return Render('Task creation failed.', memory_logs)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698