diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-12-21 16:04:57 +0100 |
---|---|---|
committer | Amber Brown <hawkowl@atleastfornow.net> | 2018-12-22 02:04:57 +1100 |
commit | 9c2af7b2c51e31a1baf5ef523a251b946774468c (patch) | |
tree | 6c5fe1adda3c4728c36313de4fcfd53699ab2779 /synapse/config/metrics.py | |
parent | Fix indentation in default config (#4313) (diff) | |
download | synapse-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.py | 12 |
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 |