summary refs log tree commit diff
path: root/synapse/metrics
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2015-03-10 15:29:22 +0000
committerPaul "LeoNerd" Evans <paul@matrix.org>2015-03-12 16:24:51 +0000
commit2e4f0b2bd736fd70040d936145948b65b4e00b12 (patch)
treef9a631dc9895be2c04ee74cf9d63b5b0c2ce9d47 /synapse/metrics
parentAdd an .inc_by() method to CounterMetric; implement DistributionMetric a neat... (diff)
downloadsynapse-2e4f0b2bd736fd70040d936145948b65b4e00b12.tar.xz
Replace the @metrics.counted annotations in federation with specifically-written counters and distributions
Diffstat (limited to 'synapse/metrics')
-rw-r--r--synapse/metrics/__init__.py17
1 files changed, 0 insertions, 17 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index f85c6418e5..94164974fc 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -62,23 +62,6 @@ class Metrics(object):
     def register_cache(self, *args, **kwargs):
         return self._register(CacheMetric, *args, **kwargs)
 
-    def counted(self, func):
-        """ A method decorator that registers a counter, to count invocations
-        of this method. """
-        if not hasattr(self, "method_counter"):
-            self.method_counter = self.register_counter(
-                "calls",
-                labels=["method"]
-            )
-
-        counter = self.method_counter
-        name = func.__name__
-
-        def wrapped(*args, **kwargs):
-            counter.inc(name)
-            return func(*args, **kwargs)
-        return wrapped
-
 
 def get_metrics_for(pkg_name):
     """ Returns a Metrics instance for conveniently creating metrics