Эх сурвалжийг харах

[desktop] Simplify many of the metric names

Erick Tryzelaar 10 жил өмнө
parent
commit
18c8d0f5fc

+ 14 - 14
desktop/core/src/desktop/metrics.py

@@ -27,7 +27,7 @@ from django.dispatch import receiver
 from desktop.lib.metrics import global_registry
 from desktop.lib.metrics import global_registry
 
 
 global_registry().gauge_callback(
 global_registry().gauge_callback(
-    name='python.threads.count',
+    name='python.threads.total',
     callback=lambda: len(threading.enumerate()),
     callback=lambda: len(threading.enumerate()),
     label='Thread count',
     label='Thread count',
     description='Number of threads',
     description='Number of threads',
@@ -53,7 +53,7 @@ global_registry().gauge_callback(
 # ------------------------------------------------------------------------------
 # ------------------------------------------------------------------------------
 
 
 global_registry().gauge_callback(
 global_registry().gauge_callback(
-    name='python.multiprocessing.count',
+    name='python.multiprocessing.total',
     callback=lambda: len(multiprocessing.active_children()),
     callback=lambda: len(multiprocessing.active_children()),
     label='Process count',
     label='Process count',
     description='Number of multiprocessing processes',
     description='Number of multiprocessing processes',
@@ -88,7 +88,7 @@ for i in xrange(3):
   )
   )
 
 
 global_registry().gauge_callback(
 global_registry().gauge_callback(
-    name='python.gc.objects.count',
+    name='python.gc.objects',
     callback=lambda: len(gc.get_objects()),
     callback=lambda: len(gc.get_objects()),
     label='GC tracked object count',
     label='GC tracked object count',
     description='Number of objects being tracked by the garbage collector',
     description='Number of objects being tracked by the garbage collector',
@@ -96,7 +96,7 @@ global_registry().gauge_callback(
 )
 )
 
 
 global_registry().gauge_callback(
 global_registry().gauge_callback(
-    name='python.gc.referrers.count',
+    name='python.gc.referrers',
     callback=lambda: len(gc.get_referrers()),
     callback=lambda: len(gc.get_referrers()),
     label='GC tracked object referrers',
     label='GC tracked object referrers',
     description='Number of objects that directly refer to any objects',
     description='Number of objects that directly refer to any objects',
@@ -104,7 +104,7 @@ global_registry().gauge_callback(
 )
 )
 
 
 global_registry().gauge_callback(
 global_registry().gauge_callback(
-    name='python.gc.referents.count',
+    name='python.gc.referents',
     callback=lambda: len(gc.get_referrers()),
     callback=lambda: len(gc.get_referrers()),
     label='GC tracked object referents',
     label='GC tracked object referents',
     description='Number of objects that directly referred to any objects',
     description='Number of objects that directly referred to any objects',
@@ -114,21 +114,21 @@ global_registry().gauge_callback(
 # ------------------------------------------------------------------------------
 # ------------------------------------------------------------------------------
 
 
 active_requests = global_registry().counter(
 active_requests = global_registry().counter(
-    name='desktop.requests.active.count',
+    name='requests.active',
     label='Active requests',
     label='Active requests',
     description='Number of currently active requests',
     description='Number of currently active requests',
     numerator='active requests',
     numerator='active requests',
 )
 )
 
 
 request_exceptions = global_registry().counter(
 request_exceptions = global_registry().counter(
-    name='desktop.requests.exceptions.count',
+    name='requests.exceptions',
     label='Request exceptions',
     label='Request exceptions',
     description='Number requests that resulted in an exception',
     description='Number requests that resulted in an exception',
     numerator='failed requests',
     numerator='failed requests',
 )
 )
 
 
 response_time = global_registry().timer(
 response_time = global_registry().timer(
-    name='desktop.requests.aggregate-response-time',
+    name='requests.aggregate-response-time',
     label='Request aggregate response time',
     label='Request aggregate response time',
     description='Time taken to respond to requests',
     description='Time taken to respond to requests',
     numerator='seconds',
     numerator='seconds',
@@ -139,7 +139,7 @@ response_time = global_registry().timer(
 # ------------------------------------------------------------------------------
 # ------------------------------------------------------------------------------
 
 
 user_count = global_registry().gauge_callback(
 user_count = global_registry().gauge_callback(
-    name='desktop.users.count',
+    name='users.total',
     callback=lambda: User.objects.count(),
     callback=lambda: User.objects.count(),
     label='User count',
     label='User count',
     description='Total number of users',
     description='Total number of users',
@@ -147,7 +147,7 @@ user_count = global_registry().gauge_callback(
 )
 )
 
 
 logged_in_users = global_registry().counter(
 logged_in_users = global_registry().counter(
-    name='desktop.users.logged-in.count',
+    name='users.logged-in',
     label='Number of logged in users',
     label='Number of logged in users',
     description='Number of logged in users',
     description='Number of logged in users',
     numerator='logged in users',
     numerator='logged in users',
@@ -164,7 +164,7 @@ def user_logged_out_handler(sender, **kwargs):
 # ------------------------------------------------------------------------------
 # ------------------------------------------------------------------------------
 
 
 ldap_authentication_time = global_registry().timer(
 ldap_authentication_time = global_registry().timer(
-    name='desktop.auth.ldap.authentication-time',
+    name='ldap.authentication-time',
     label='LDAP Authentication time',
     label='LDAP Authentication time',
     description='Time taken to authenticate a user with LDAP',
     description='Time taken to authenticate a user with LDAP',
     numerator='seconds',
     numerator='seconds',
@@ -173,7 +173,7 @@ ldap_authentication_time = global_registry().timer(
 )
 )
 
 
 oauth_authentication_time = global_registry().timer(
 oauth_authentication_time = global_registry().timer(
-    name='desktop.auth.oauth.authentication-time',
+    name='auth.oauth.authentication-time',
     label='OAUTH Authentication time',
     label='OAUTH Authentication time',
     description='Time taken to authenticate a user with OAUTH',
     description='Time taken to authenticate a user with OAUTH',
     numerator='seconds',
     numerator='seconds',
@@ -182,7 +182,7 @@ oauth_authentication_time = global_registry().timer(
 )
 )
 
 
 pam_authentication_time = global_registry().timer(
 pam_authentication_time = global_registry().timer(
-    name='desktop.auth.pam.authentication-time',
+    name='auth.pam.authentication-time',
     label='PAM Authentication time',
     label='PAM Authentication time',
     description='Time taken to authenticate a user with PAM',
     description='Time taken to authenticate a user with PAM',
     numerator='seconds',
     numerator='seconds',
@@ -191,7 +191,7 @@ pam_authentication_time = global_registry().timer(
 )
 )
 
 
 spnego_authentication_time = global_registry().timer(
 spnego_authentication_time = global_registry().timer(
-    name='desktop.auth.spnego.authentication-time',
+    name='auth.spnego.authentication-time',
     label='SPNEGO Authentication time',
     label='SPNEGO Authentication time',
     description='Time taken to authenticate a user with SPNEGO',
     description='Time taken to authenticate a user with SPNEGO',
     numerator='seconds',
     numerator='seconds',

+ 1 - 1
desktop/libs/libopenid/src/libopenid/metrics.py

@@ -19,7 +19,7 @@ from __future__ import absolute_import
 from desktop.lib.metrics import global_registry
 from desktop.lib.metrics import global_registry
 
 
 openid_authentication_time = global_registry().timer(
 openid_authentication_time = global_registry().timer(
-    name='desktop.auth.openid.authentication-time',
+    name='openid.authentication-time',
     label='OpenID Authentication time',
     label='OpenID Authentication time',
     description='Time taken to authenticate a user with OpenID',
     description='Time taken to authenticate a user with OpenID',
     numerator='s',
     numerator='s',

+ 1 - 1
desktop/libs/libsaml/src/libsaml/metrics.py

@@ -19,7 +19,7 @@ from __future__ import absolute_import
 from desktop.lib.metrics import global_registry
 from desktop.lib.metrics import global_registry
 
 
 saml2_authentication_time = global_registry().timer(
 saml2_authentication_time = global_registry().timer(
-    name='desktop.auth.saml2.authentication-time',
+    name='saml2.authentication-time',
     label='SAML2 Authentication time',
     label='SAML2 Authentication time',
     description='Time taken to authenticate a user with SAML2',
     description='Time taken to authenticate a user with SAML2',
     numerator='s',
     numerator='s',