diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-07 10:46:56 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-07 10:46:56 +0000 |
commit | 37dd19935b7fe6942670de41d0da55e6c1d339d5 (patch) | |
tree | b364b3a159e1d70f9a51849fce2a4dd9eb19d3ad /app/controllers/sessions_controller.rb | |
parent | 19982333d741119b395ef97fc3cdf7153313fad9 (diff) | |
parent | 1c59ba67a539e9ef7298b1c219123200eeb54b01 (diff) | |
download | gitlab-ce-37dd19935b7fe6942670de41d0da55e6c1d339d5.tar.gz |
Merge branch 'instrument-infra' into 'master'
Add Prometheus metrics endpoint and basic infrastructure to meter code
See merge request !11553
Diffstat (limited to 'app/controllers/sessions_controller.rb')
-rw-r--r-- | app/controllers/sessions_controller.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 10806895764..d7c702b94f8 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -47,6 +47,10 @@ class SessionsController < Devise::SessionsController private + def login_counter + @login_counter ||= Gitlab::Metrics.counter(:user_session_logins, 'User sign in count') + end + # Handle an "initial setup" state, where there's only one user, it's an admin, # and they require a password change. def check_initial_setup @@ -129,6 +133,7 @@ class SessionsController < Devise::SessionsController end def log_user_activity(user) + login_counter.increment Users::ActivityService.new(user, 'login').execute end |