Skip to content
Snippets Groups Projects
Commit 1cc22da6 authored by Paul "LeoNerd" Evans's avatar Paul "LeoNerd" Evans
Browse files

Set up the process collector during metrics __init__; that way all split-process workers have it

parent aac13b1f
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,6 @@ from synapse.config.homeserver import HomeServerConfig ...@@ -52,7 +52,6 @@ from synapse.config.homeserver import HomeServerConfig
from synapse.crypto import context_factory from synapse.crypto import context_factory
from synapse.util.logcontext import LoggingContext from synapse.util.logcontext import LoggingContext
from synapse.metrics import register_memory_metrics, get_metrics_for from synapse.metrics import register_memory_metrics, get_metrics_for
from synapse.metrics.process_collector import register_process_collector
from synapse.metrics.resource import MetricsResource, METRICS_PREFIX from synapse.metrics.resource import MetricsResource, METRICS_PREFIX
from synapse.replication.resource import ReplicationResource, REPLICATION_PREFIX from synapse.replication.resource import ReplicationResource, REPLICATION_PREFIX
from synapse.federation.transport.server import TransportLayerServer from synapse.federation.transport.server import TransportLayerServer
...@@ -338,7 +337,6 @@ def setup(config_options): ...@@ -338,7 +337,6 @@ def setup(config_options):
hs.get_replication_layer().start_get_pdu_cache() hs.get_replication_layer().start_get_pdu_cache()
register_memory_metrics(hs) register_memory_metrics(hs)
register_process_collector(get_metrics_for("process"))
reactor.callWhenRunning(start) reactor.callWhenRunning(start)
......
...@@ -24,6 +24,7 @@ from .metric import ( ...@@ -24,6 +24,7 @@ from .metric import (
CounterMetric, CallbackMetric, DistributionMetric, CacheMetric, CounterMetric, CallbackMetric, DistributionMetric, CacheMetric,
MemoryUsageMetric, MemoryUsageMetric,
) )
from .process_collector import register_process_collector
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -121,6 +122,8 @@ reactor_metrics.register_callback( ...@@ -121,6 +122,8 @@ reactor_metrics.register_callback(
"gc_counts", lambda: {(i,): v for i, v in enumerate(gc.get_count())}, labels=["gen"] "gc_counts", lambda: {(i,): v for i, v in enumerate(gc.get_count())}, labels=["gen"]
) )
register_process_collector(get_metrics_for("process"))
def runUntilCurrentTimer(func): def runUntilCurrentTimer(func):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment