Skip to content

Commit

Permalink
use correct strategy to compute used quota. Fix #8867 (#8868)
Browse files Browse the repository at this point in the history
  • Loading branch information
belforte authored Dec 19, 2024
1 parent 446f4a8 commit 97e7e25
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/script/Monitor/ReportRecallQuota.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ def main(log):
# prepare a JSON to be sent to MONIT
jsonDoc = {'producer': MONITUSER, 'type': 'reportrecallquota', 'hostname': gethostname()}
# get info for the used account, each will be sent with ad-hoc tag in the JSON
accounts = [{'name': 'crab_tape_recall', 'tag': 'tape_recall_total_TB'},
{'name': 'crab_input', 'tag': 'crab_input_total_TB'}]
# different strategies need to be used for tape reall and input locking
# tape recall rules are created on the various user accounts, so need to sum by activity
# input locking rules are all created by crab_input account and used quota can be obained very simply
accounts = [{'name': None, 'activity': 'Analysis TapeRecall', 'tag': 'tape_recall_total_TB'},
{'name': 'crab_input', 'activity': None, 'tag': 'crab_input_total_TB'}]
for account in accounts:
if account['name']=='crab_tape_recall':
activity='Analysis TapeRecall'
elif account['name']=='crab_input':
activity='Analysis Input'
report = createQuotaReport(rucioClient=rucioClient, account=account['name'], activity=activity)
report = createQuotaReport(rucioClient=rucioClient,
account=account['name'],
activity=account['activity'])
jsonDoc[account['tag']] = report['totalTB']
send_and_check(jsonDoc)

Expand Down

0 comments on commit 97e7e25

Please sign in to comment.