From 5a45f505839adba8b982be55c37a595b58521d72 Mon Sep 17 00:00:00 2001 From: yackob03 Date: Thu, 14 Nov 2013 14:53:55 -0500 Subject: [PATCH] Log the repository name when pushing and pulling. --- endpoints/index.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/endpoints/index.py b/endpoints/index.py index 6b0cde6d8..0fb1ad990 100644 --- a/endpoints/index.py +++ b/endpoints/index.py @@ -157,10 +157,15 @@ def create_repository(namespace, repository): response = make_response('Created', 201) + extra_params = { + 'repository': '%s/%s' % (namespace, repository), + } + if get_authenticated_user(): - mixpanel.track(get_authenticated_user().username, 'push_repo') + mixpanel.track(get_authenticated_user().username, 'push_repo', + extra_params) else: - mixpanel.track(get_validated_token().code, 'push_repo') + mixpanel.track(get_validated_token().code, 'push_repo', extra_params) return response @@ -220,7 +225,10 @@ def get_repository_images(namespace, repository): if get_authenticated_user(): pull_username = get_authenticated_user().username - mixpanel.track(pull_username, 'pull_repo') + extra_params = { + 'repository': '%s/%s' % (namespace, repository), + } + mixpanel.track(pull_username, 'pull_repo', extra_params) return resp