summary refs log tree commit diff
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <oliverw@matrix.org>2022-01-19 14:50:34 +0000
committerOlivier Wilkinson (reivilibre) <oliverw@matrix.org>2022-01-19 14:50:34 +0000
commit54c230d80c2918e01635c07633732a0d08abbc97 (patch)
treef9637055bbffadf2bb04fa93bd357bf289d3cd83
parentActually call the `setup_viztracer` function (diff)
downloadsynapse-54c230d80c2918e01635c07633732a0d08abbc97.tar.xz
Use the SYNAPSE_VIZTRACER as the output path github/rei/1.50.1_viztracer rei/1.50.1_viztracer
-rw-r--r--synapse/app/homeserver.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index e11c81d642..8034113e47 100644
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -456,13 +456,16 @@ def setup_viztracer() -> None:
     def eprint(msg: str) -> None:
         print(msg, file=sys.stderr)
 
-    if os.environ.get("SYNAPSE_VIZTRACER", ""):
-        eprint("SYNAPSE_VIZTRACER is set. Installing VizTracer hooks.")
+    viztracer_output_path = os.environ.get("SYNAPSE_VIZTRACER", "")
+    if viztracer_output_path:
+        eprint(
+            f"SYNAPSE_VIZTRACER is set. Installing VizTracer hooks to output to {viztracer_output_path}."
+        )
 
         try:
             from viztracer import VizTracer
 
-            VizTracer().install()
+            VizTracer(output_file=viztracer_output_path).install()
         except ImportError:
             eprint("VizTracer could not be imported: can't install hooks.")
     else: