summary refs log tree commit diff
path: root/synapse/config/metrics.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-12-21 16:04:57 +0100
committerAmber Brown <hawkowl@atleastfornow.net>2018-12-22 02:04:57 +1100
commit9c2af7b2c51e31a1baf5ef523a251b946774468c (patch)
tree6c5fe1adda3c4728c36313de4fcfd53699ab2779 /synapse/config/metrics.py
parentFix indentation in default config (#4313) (diff)
downloadsynapse-9c2af7b2c51e31a1baf5ef523a251b946774468c.tar.xz
Add a script to generate a clean config file (#4315)
Diffstat (limited to 'synapse/config/metrics.py')
-rw-r--r--synapse/config/metrics.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/synapse/config/metrics.py b/synapse/config/metrics.py
index 61155c99d0..718c43ae03 100644
--- a/synapse/config/metrics.py
+++ b/synapse/config/metrics.py
@@ -24,10 +24,16 @@ class MetricsConfig(Config):
         self.metrics_bind_host = config.get("metrics_bind_host", "127.0.0.1")
 
     def default_config(self, report_stats=None, **kwargs):
-        suffix = "" if report_stats is None else "report_stats: %(report_stats)s\n"
-        return ("""\
+        res = """\
         ## Metrics ###
 
         # Enable collection and rendering of performance metrics
         enable_metrics: False
-        """ + suffix) % locals()
+        """
+
+        if report_stats is None:
+            res += "# report_stats: true|false\n"
+        else:
+            res += "report_stats: %s\n" % ('true' if report_stats else 'false')
+
+        return res