From 9ffebd0c5eee5155ba35b6ce02f6e12abf5b8ece Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Fri, 1 Apr 2016 14:05:02 -0700 Subject: [PATCH] Send metrics about various redirects from User spawning --- jupyterhub/handlers/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jupyterhub/handlers/base.py b/jupyterhub/handlers/base.py index f5ac56d8..06847c4b 100644 --- a/jupyterhub/handlers/base.py +++ b/jupyterhub/handlers/base.py @@ -478,6 +478,7 @@ class UserSpawnHandler(BaseHandler): if current_user.spawner: if current_user.spawn_pending: # spawn has started, but not finished + self.statsd.incr('redirects.user_spawn_pending', 1) html = self.render_template("spawn_pending.html", user=current_user) self.finish(html) return @@ -497,12 +498,15 @@ class UserSpawnHandler(BaseHandler): if self.subdomain_host: target = current_user.host + target self.redirect(target) + self.statsd.incr('redirects.user_after_login') elif current_user: # logged in as a different user, redirect + self.statsd.incr('redirects.user_to_user', 1) target = url_path_join(current_user.url, user_path or '') self.redirect(target) else: # not logged in, clear any cookies and reload + self.statsd.incr('redirects.user_to_login', 1) self.clear_login_cookie() self.redirect(url_concat( self.settings['login_url'],