diff --git a/workflows/pipe-common/scripts/send_statistics.py b/workflows/pipe-common/scripts/send_statistics.py index 6c3cc00ae9..8afebeb5f9 100644 --- a/workflows/pipe-common/scripts/send_statistics.py +++ b/workflows/pipe-common/scripts/send_statistics.py @@ -347,6 +347,7 @@ def _get_statistics(api, capabilities, logger, platform_usage_costs, from_date, top3_pipelines = _get_top3(runs, "Pipeline") logger.info('Top 3 Pipelines: {}.'.format(top3_pipelines)) top3_tools = _get_top3(runs, "Tool") + top3_tools = _prepare_tools(top3_tools) logger.info('Top 3 Tools: {}.'.format(top3_tools)) top3_used_buckets = _get_used_buckets(api, from_date_time, to_date_time, user_id) logger.info('Top 3 Used buckets: {}.'.format(top3_used_buckets)) @@ -357,6 +358,13 @@ def _get_statistics(api, capabilities, logger, platform_usage_costs, from_date, top3_instance_types, top3_pipelines, top3_tools, top3_used_buckets, top3_run_capabilities) +def _prepare_tools(top3_tools): + result = [] + for key, value in top3_tools: + result.append((key.split('/', 1)[1], value)) + return result + + def _get_login_time(api, from_date_time, to_date_time, user): users_report = api.report_users(from_date_time, to_date_time, [user]) active_hours_list = [1 for d in users_report if d.get('activeUsers') is not None]