[autotest] Include DUT totals in lab inventory log messages.
This adds a short summary of the total number of DUTs found for each
board or board+pool combination that's logged during inventory
processing. The intent is to be able to put a time boundary on
unexpected changes in inventory allocations.
BUG=chromium:623137
TEST=run locally, see the new logging messages.
Change-Id: I6aa27d3657d422d308042ff791db0bf67e86d4c9
Reviewed-on: https://chromium-review.googlesource.com/358642
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
diff --git a/site_utils/lab_inventory.py b/site_utils/lab_inventory.py
index 14fec31..c1e5b2d 100755
--- a/site_utils/lab_inventory.py
+++ b/site_utils/lab_inventory.py
@@ -742,8 +742,9 @@
ntotal_boards = 0
summaries = []
for board in inventory.get_managed_boards():
- logging.debug('Counting board inventory for %s', board)
counts = inventory[board]
+ logging.debug('Counting %2d DUTS for board %s',
+ counts.get_total(), board)
# Summary elements laid out in the same order as the text
# headers:
# Board Avail Bad Idle Good Spare Total
@@ -823,8 +824,8 @@
'Board', 'Bad', 'Idle', 'Good', 'Total'))
data_list = []
for board, counts in inventory.items():
- logging.debug('Counting inventory for %s, %s',
- board, pool)
+ logging.debug('Counting %2d DUTs for %s, %s',
+ counts.get_total(pool), board, pool)
broken = counts.get_broken(pool)
idle = counts.get_idle(pool)
# boards at full strength are not reported
@@ -872,7 +873,8 @@
data_list = []
for pool in MANAGED_POOLS:
for board, counts in inventory.items():
- logging.debug('Counting inventory for %s, %s', board, pool)
+ logging.debug('Counting %2d DUTs for %s, %s',
+ counts.get_total(pool), board, pool)
data_list.extend([(dut.host.hostname, board, pool)
for dut in counts.get_idle_list(pool)])
if data_list: