Skip to content

Commit

Permalink
Issue #3161 Users stats - improvements
Browse files Browse the repository at this point in the history
(cherry picked from commit 6478ac2)
  • Loading branch information
mzueva authored and sidoruka committed Aug 31, 2023
1 parent 40d118a commit eba8752
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions workflows/pipe-common/scripts/send_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def _get_used_buckets(api, from_date_time, to_date_time, user_id, storages):
"fromDate": from_date_time,
"toDate": to_date_time,
"maxEntries": 3,
"group_by": "storage_id",
"groupBy": "storage_id",
"sorting": {
"field": "total_requests",
"order": "DESC"
Expand All @@ -522,7 +522,8 @@ def _get_used_buckets(api, from_date_time, to_date_time, user_id, storages):
return top3_storages
for storage in requests_by_storage.get('statistics'):
storage_id = int(storage.get('id'))
storage_name = storages.get(storage_id, 'Deleted (%d)' % storage_id)
storage_entity = storages.get(storage_id, None)
storage_name = storage_entity.get('name') if storage_entity else 'Deleted (%d)' % storage_id
top3_storages.append((storage_name, storage.get('totalRequests')))
return top3_storages

Expand Down

0 comments on commit eba8752

Please sign in to comment.