Add a management command for active user stats

(imported from commit a4227858b422c48e272700880e0c21889c7ce566)
This commit is contained in:
Leo Franchi
2013-04-30 17:58:59 -04:00
parent 57c5ea365a
commit 5ef7c4e6db
2 changed files with 48 additions and 1 deletions

View File

@@ -5,13 +5,15 @@ import hashlib
from time import sleep, time
from django.conf import settings
def statsd_key(val):
def statsd_key(val, clean_periods=False):
if not isinstance(val, str):
val = str(val)
if ':' in val:
val = val.split(':')[0]
val = val.replace('-', "_")
if clean_periods:
val = val.replace('.', '_')
return val