summary refs log tree commit diff
path: root/synapse/replication/tcp/resource.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-05-22 10:56:03 -0500
committerAmber Brown <hawkowl@atleastfornow.net>2018-05-22 10:56:03 -0500
commit8f5a688d420c8f6b51826c561da9094b76fbea1e (patch)
tree28fad2087a86d9aa6f4100985d3b83c7c970cf83 /synapse/replication/tcp/resource.py
parentMerge remote-tracking branch 'origin/develop' into 3218-official-prom (diff)
downloadsynapse-8f5a688d420c8f6b51826c561da9094b76fbea1e.tar.xz
cleanups, self-registration
Diffstat (limited to '')
-rw-r--r--synapse/replication/tcp/resource.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/replication/tcp/resource.py b/synapse/replication/tcp/resource.py
index ed251c79ac..1ca30bc31a 100644
--- a/synapse/replication/tcp/resource.py
+++ b/synapse/replication/tcp/resource.py
@@ -73,8 +73,8 @@ class ReplicationStreamer(object):
         # Current connections.
         self.connections = []
 
-        l = LaterGauge("synapse_replication_tcp_resource_total_connections", "", [], lambda: len(self.connections))
-        l.register()
+        LaterGauge("synapse_replication_tcp_resource_total_connections", "", [],
+                   lambda: len(self.connections))
 
         # List of streams that clients can subscribe to.
         # We only support federation stream if federation sending hase been
@@ -87,14 +87,15 @@ class ReplicationStreamer(object):
         self.streams_by_name = {stream.NAME: stream for stream in self.streams}
 
         LaterGauge(
-            "synapse_replication_tcp_resource_connections_per_stream", "", ["stream_name"],
+            "synapse_replication_tcp_resource_connections_per_stream", "",
+            ["stream_name"],
             lambda: {
                 (stream_name,): len([
                     conn for conn in self.connections
                     if stream_name in conn.replication_streams
                 ])
                 for stream_name in self.streams_by_name
-            }).register()
+            })
 
         self.federation_sender = None
         if not hs.config.send_federation: