Add a worker for reporting global stats to Prometheus

Fixes #1789
This commit is contained in:
Joseph Schorr 2016-09-12 16:19:19 -04:00
parent 818ea38dac
commit 30af8aef1a
5 changed files with 72 additions and 0 deletions

View file

@ -643,6 +643,10 @@ def get_active_user_count():
return get_active_users().count()
def get_robot_count():
return User.select().where(User.robot == True).count()
def detach_external_login(user, service_name):
try:
service = LoginService.get(name=service_name)