summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-10-22 12:33:21 +0100
committerGitHub <noreply@github.com>2018-10-22 12:33:21 +0100
commit911db96658ffd0fca79dbd19499813ca75f65518 (patch)
treecc11cbf13e9f19f47b733bb029fcc19803a61b71 /synapse/app
parentuh, Matrix is called Matrix these days... (diff)
parentMake psutil an explicit dependency (diff)
downloadsynapse-911db96658ffd0fca79dbd19499813ca75f65518.tar.xz
Merge pull request #4073 from matrix-org/rav/require_psutil
Make psutil an explicit dependency
Diffstat (limited to 'synapse/app')
-rwxr-xr-xsynapse/app/homeserver.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 84f8fe2d9e..803d536ccd 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -20,6 +20,7 @@ import sys
 
 from six import iteritems
 
+import psutil
 from prometheus_client import Gauge
 
 from twisted.application import service
@@ -502,7 +503,6 @@ def run(hs):
 
     def performance_stats_init():
         try:
-            import psutil
             process = psutil.Process()
             # Ensure we can fetch both, and make the initial request for cpu_percent
             # so the next request will use this as the initial point.
@@ -510,12 +510,9 @@ def run(hs):
             process.cpu_percent(interval=None)
             logger.info("report_stats can use psutil")
             stats_process.append(process)
-        except (ImportError, AttributeError):
-            logger.warn(
-                "report_stats enabled but psutil is not installed or incorrect version."
-                " Disabling reporting of memory/cpu stats."
-                " Ensuring psutil is available will help matrix.org track performance"
-                " changes across releases."
+        except (AttributeError):
+            logger.warning(
+                "Unable to read memory/cpu stats. Disabling reporting."
             )
 
     def generate_user_daily_visit_stats():