mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-02 13:06:04 -04:00
Add metrics for psutil derived memory usage
This commit is contained in:
parent
1e2a7f18a1
commit
66868119dc
4 changed files with 50 additions and 1 deletions
|
@ -27,7 +27,8 @@ import gc
|
|||
from twisted.internet import reactor
|
||||
|
||||
from .metric import (
|
||||
CounterMetric, CallbackMetric, DistributionMetric, CacheMetric
|
||||
CounterMetric, CallbackMetric, DistributionMetric, CacheMetric,
|
||||
MemoryUsageMetric,
|
||||
)
|
||||
|
||||
|
||||
|
@ -66,6 +67,12 @@ class Metrics(object):
|
|||
return self._register(CacheMetric, *args, **kwargs)
|
||||
|
||||
|
||||
def register_memory_metrics(hs):
|
||||
metric = MemoryUsageMetric(hs)
|
||||
all_metrics.append(metric)
|
||||
return metric
|
||||
|
||||
|
||||
def get_metrics_for(pkg_name):
|
||||
""" Returns a Metrics instance for conveniently creating metrics
|
||||
namespaced with the given name prefix. """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue