From eba87520f21da0535411163f17d13b9c72876e59 Mon Sep 17 00:00:00 2001 From: mzueva Date: Wed, 30 Aug 2023 19:34:26 +0200 Subject: [PATCH] Issue #3161 Users stats - improvements (cherry picked from commit 6478ac2f42fd91946d63317ff8660062069074f7) --- workflows/pipe-common/scripts/send_statistics.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/workflows/pipe-common/scripts/send_statistics.py b/workflows/pipe-common/scripts/send_statistics.py index 15eff24612..e0b3eb43f1 100644 --- a/workflows/pipe-common/scripts/send_statistics.py +++ b/workflows/pipe-common/scripts/send_statistics.py @@ -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" @@ -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