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

Issue 2198063002: Add bots.count endpoint (Closed)

Created:
4 years, 4 months ago by kjlubick
Modified:
4 years, 4 months ago
Reviewers:
M-A Ruel
CC:
chromium-reviews, infra-reviews+luci-py_chromium.org
Base URL:
https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Target Ref:
refs/heads/master
Project:
luci-py
Visibility:
Public.

Description

Add bots.count endpoint This is analogous to tasks.count, with the addition of a count of dead, quarantined and busy bots. BUG=631047 Committed: https://github.com/luci/luci-py/commit/42b792562b6445d315416c6e306d24a71fa3626d

Patch Set 1 #

Patch Set 2 : copypasta #

Total comments: 10

Patch Set 3 : POC endpoint working #

Patch Set 4 : Add test #

Patch Set 5 : Also count quarantined and dead #

Patch Set 6 : Add dead, quarantined, busy #

Total comments: 4

Patch Set 7 : Run them in parallel #

Total comments: 4

Patch Set 8 : Address nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -0 lines) Patch
M appengine/swarming/handlers_endpoints.py View 1 2 3 4 5 6 7 1 chunk +30 lines, -0 lines 0 comments Download
M appengine/swarming/handlers_endpoints_test.py View 1 2 3 4 5 6 7 1 chunk +68 lines, -0 lines 0 comments Download
M appengine/swarming/swarming_rpcs.py View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 14 (6 generated)
M-A Ruel
https://codereview.chromium.org/2198063002/diff/20001/appengine/swarming/handlers_endpoints.py File appengine/swarming/handlers_endpoints.py (right): https://codereview.chromium.org/2198063002/diff/20001/appengine/swarming/handlers_endpoints.py#newcode647 appengine/swarming/handlers_endpoints.py:647: q = bot_management.BotInfo.query().order(bot_management.BotInfo.key) order is not needed for counting. ...
4 years, 4 months ago (2016-08-01 15:33:14 UTC) #2
kjlubick
Tests have been added, PTAL https://codereview.chromium.org/2198063002/diff/20001/appengine/swarming/handlers_endpoints.py File appengine/swarming/handlers_endpoints.py (right): https://codereview.chromium.org/2198063002/diff/20001/appengine/swarming/handlers_endpoints.py#newcode647 appengine/swarming/handlers_endpoints.py:647: q = bot_management.BotInfo.query().order(bot_management.BotInfo.key) On ...
4 years, 4 months ago (2016-08-01 17:26:32 UTC) #5
M-A Ruel
https://codereview.chromium.org/2198063002/diff/100001/appengine/swarming/handlers_endpoints.py File appengine/swarming/handlers_endpoints.py (right): https://codereview.chromium.org/2198063002/diff/100001/appengine/swarming/handlers_endpoints.py#newcode656 appengine/swarming/handlers_endpoints.py:656: dead = q.filter(bot_management.BotInfo.last_seen_ts < timeout).count() you are serializing 3 ...
4 years, 4 months ago (2016-08-01 18:27:19 UTC) #6
kjlubick
https://codereview.chromium.org/2198063002/diff/100001/appengine/swarming/handlers_endpoints.py File appengine/swarming/handlers_endpoints.py (right): https://codereview.chromium.org/2198063002/diff/100001/appengine/swarming/handlers_endpoints.py#newcode656 appengine/swarming/handlers_endpoints.py:656: dead = q.filter(bot_management.BotInfo.last_seen_ts < timeout).count() On 2016/08/01 at 18:27:19, ...
4 years, 4 months ago (2016-08-01 19:15:20 UTC) #7
M-A Ruel
lgtm with two fixes, thanks for driving this through! https://codereview.chromium.org/2198063002/diff/120001/appengine/swarming/handlers_endpoints.py File appengine/swarming/handlers_endpoints.py (right): https://codereview.chromium.org/2198063002/diff/120001/appengine/swarming/handlers_endpoints.py#newcode656 appengine/swarming/handlers_endpoints.py:656: ...
4 years, 4 months ago (2016-08-01 19:18:37 UTC) #8
kjlubick
https://codereview.chromium.org/2198063002/diff/120001/appengine/swarming/handlers_endpoints.py File appengine/swarming/handlers_endpoints.py (right): https://codereview.chromium.org/2198063002/diff/120001/appengine/swarming/handlers_endpoints.py#newcode656 appengine/swarming/handlers_endpoints.py:656: q_dead = (q.filter(bot_management.BotInfo.last_seen_ts < timeout) On 2016/08/01 at 19:18:37, ...
4 years, 4 months ago (2016-08-01 19:25:43 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2198063002/140001
4 years, 4 months ago (2016-08-01 19:25:52 UTC) #12
commit-bot: I haz the power
4 years, 4 months ago (2016-08-01 19:29:09 UTC) #14
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://github.com/luci/luci-py/commit/42b792562b6445d315416c6e306d24a71fa3626d

Powered by Google App Engine
This is Rietveld 408576698