mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-17 11:09:34 -04:00
Add a script to generate a clean config file (#4315)
This commit is contained in:
parent
f3561f8d86
commit
9c2af7b2c5
11 changed files with 157 additions and 46 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue