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

Unified Diff: appengine/swarming/handlers_bot.py

Issue 2043853002: Complete CIPD integration (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@run-isolated-cipd
Patch Set: nit 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
Index: appengine/swarming/handlers_bot.py
diff --git a/appengine/swarming/handlers_bot.py b/appengine/swarming/handlers_bot.py
index e3937a4d7ed41c33dc4eeeac080afcc4efea143f..18b61b4b7d500cef22e9331254340f5b8fe24a09 100644
--- a/appengine/swarming/handlers_bot.py
+++ b/appengine/swarming/handlers_bot.py
@@ -504,7 +504,7 @@ class BotTaskUpdateHandler(_BotApiHandler):
out-of-order packets.
"""
ACCEPTED_KEYS = {
- u'bot_overhead', u'cost_usd', u'duration', u'exit_code',
+ u'bot_overhead', u'cipd_stats', u'cost_usd', u'duration', u'exit_code',
u'hard_timeout', u'id', u'io_timeout', u'isolated_stats', u'output',
u'output_chunk_start', u'outputs_ref', u'task_id',
}
@@ -534,11 +534,12 @@ class BotTaskUpdateHandler(_BotApiHandler):
hard_timeout = request.get('hard_timeout')
io_timeout = request.get('io_timeout')
isolated_stats = request.get('isolated_stats')
+ cipd_stats = request.get('cipd_stats')
output = request.get('output')
output_chunk_start = request.get('output_chunk_start')
outputs_ref = request.get('outputs_ref')
- if isolated_stats and bot_overhead is None:
+ if (isolated_stats or cipd_stats) and bot_overhead is None:
ereporter2.log_request(
request=self.request,
source='server',
@@ -546,8 +547,8 @@ class BotTaskUpdateHandler(_BotApiHandler):
message='Failed to update task: %s' % task_id)
self.abort_with_error(
400,
- error='isolated_stats requires bot_overhead to be set'
- '\nbot_overhead: %s\nisolated_stats: %s' %
+ error='isolated_stats and cipd_stats require bot_overhead to be set'
+ '\nbot_overhead: %s\nisolate_stats: %s' %
(bot_overhead, isolated_stats))
run_result_key = task_pack.unpack_run_result_key(task_id)
@@ -572,6 +573,9 @@ class BotTaskUpdateHandler(_BotApiHandler):
duration=upload.get('duration'),
items_cold=unpack_base64(upload, 'items_cold'),
items_hot=unpack_base64(upload, 'items_hot'))
+ if cipd_stats:
+ performance_stats.package_installation = task_result.OperationStats(
+ duration=cipd_stats.get('duration'))
if output is not None:
try:
« no previous file with comments | « no previous file | appengine/swarming/server/task_request.py » ('j') | appengine/swarming/swarming_bot/bot_code/task_runner.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698