Commit b28d4054 authored by Giuseppe Lo Presti's avatar Giuseppe Lo Presti
Browse files

Added display of total count of tapes

parent 28b297d3
......@@ -166,6 +166,7 @@ def _displaySummary(rows):
sumTotal = sumSize = 0
globalStatus = 2 # FINISHED
shownVids = set()
count = 0
for subTime, lastModTime, user, machine, vid, status, total, totsize in rows:
if not vids and vid in shownVids:
# when showing full statistics skip the less recent requests for each VID
......@@ -173,6 +174,7 @@ def _displaySummary(rows):
shownVids.add(vid)
_printStatusLine(subTime, lastModTime, user, machine, vid, status, total, totsize, '-', '-', '-', '-')
sumTotal += total
count += 1
if totsize > 0:
# it may have returned None
sumSize += totsize
......@@ -181,7 +183,7 @@ def _displaySummary(rows):
print '-'*117
# when showing full statistics, print out summary line
if not vids and sumTotal > 0:
_printStatusLine(time.time(), 0, '-', '-', 'TOTAL', globalStatus, sumTotal, sumSize, '-', '-', '-', '-')
_printStatusLine(time.time(), 0, '-', 'TOTAL', count, globalStatus, sumTotal, sumSize, '-', '-', '-', '-')
def _displayDetailed(rows):
'''prints the details of all repack requests according to the given criteria'''
......@@ -191,6 +193,7 @@ def _displayDetailed(rows):
print '-'*165
sumTotal = sumSize = sumToRecall = sumToMigr = sumFailed = sumMigrated = 0
shownVids = set()
count = 0
for subTime, lastModTime, user, machine, vid, status, total, totsize, toRecall, toMigr, failed, migrated in rows:
if not vids and vid in shownVids:
# when showing full statistics skip the less recent requests for each VID
......@@ -201,6 +204,7 @@ def _displayDetailed(rows):
if totsize > 0:
# it may have returned None
sumSize += totsize
count += 1
sumToRecall += toRecall
sumToMigr += toMigr
sumFailed += failed
......@@ -212,7 +216,7 @@ def _displayDetailed(rows):
globalStatus = 1 # ONGOING
else:
globalStatus = 2 # FINISHED
_printStatusLine(time.time(), 0, '-', '-', 'TOTAL', globalStatus, sumTotal, sumSize, sumToRecall, sumToMigr, sumFailed, sumMigrated)
_printStatusLine(time.time(), 0, '-', 'TOTAL', count, globalStatus, sumTotal, sumSize, sumToRecall, sumToMigr, sumFailed, sumMigrated)
def displayStatus(detailed):
'''displays the ongoing repacks. If vids is not empty, the output is limited to these tapes'''
......
......@@ -132,7 +132,7 @@ SubmitTime RepackTime User Machine
11-Jun-13 18:57 1mn20s itglp@CERN.CH lxc2dev2.cern.ch V21002 4 3.29KiB FINISHED
10-Jun-13 15:42 1mn40s root lxc2dev2.cern.ch V22003 1 2.93KiB FINISHED
---------------------------------------------------------------------------------------------------------------------
11-Jun-13 19:29 - - - TOTAL 5 6.22KiB FINISHED
11-Jun-13 19:29 - - TOTAL 2 5 6.22KiB FINISHED
> repack -s -d
=====================================================================================================================================================================
......@@ -141,7 +141,7 @@ SubmitTime RepackTime User Machine
11-Jun-13 18:57 1mn20s itglp@CERN.CH lxc2dev2.cern.ch V21002 4 3.29KiB 0 0 0 4 100% FINISHED
10-Jun-13 15:42 1mn40s root lxc2dev2.cern.ch V22003 1 2.93KiB 0 0 0 1 100% FINISHED
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
11-Jun-13 19:29 - - - TOTAL 5 6.22KiB 0 0 0 5 100% FINISHED
11-Jun-13 19:29 - - TOTAL 2 5 6.22KiB 0 0 0 5 100% FINISHED
> repack -S V21002 -d
=====================================================================================================================================================================
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment