Skip to content

Commit

Permalink
Revert User statistics template: remove docker registry from tools
Browse files Browse the repository at this point in the history
  • Loading branch information
mzueva committed Jul 28, 2023
1 parent 979fadb commit 0d2fcfe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions workflows/pipe-common/scripts/send_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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]
Expand Down

0 comments on commit 0d2fcfe

Please sign in to comment.