diff options
author | Erik Johnston <erik@matrix.org> | 2019-09-04 13:04:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-04 13:04:27 +0100 |
commit | 6e834e94fcc97811e4cc8185e86c6b9da06eb28e (patch) | |
tree | e1b6261a6f26a96e19115ed65e3f62d0ac1bf025 /synapse/config/stats.py | |
parent | code cleanups (diff) | |
download | synapse-6e834e94fcc97811e4cc8185e86c6b9da06eb28e.tar.xz |
Fix and refactor room and user stats (#5971)
Previously the stats were not being correctly populated.
Diffstat (limited to 'synapse/config/stats.py')
-rw-r--r-- | synapse/config/stats.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/synapse/config/stats.py b/synapse/config/stats.py index b518a3ed9c..b18ddbd1fa 100644 --- a/synapse/config/stats.py +++ b/synapse/config/stats.py @@ -27,19 +27,16 @@ class StatsConfig(Config): def read_config(self, config, **kwargs): self.stats_enabled = True - self.stats_bucket_size = 86400 + self.stats_bucket_size = 86400 * 1000 self.stats_retention = sys.maxsize stats_config = config.get("stats", None) if stats_config: self.stats_enabled = stats_config.get("enabled", self.stats_enabled) - self.stats_bucket_size = ( - self.parse_duration(stats_config.get("bucket_size", "1d")) / 1000 + self.stats_bucket_size = self.parse_duration( + stats_config.get("bucket_size", "1d") ) - self.stats_retention = ( - self.parse_duration( - stats_config.get("retention", "%ds" % (sys.maxsize,)) - ) - / 1000 + self.stats_retention = self.parse_duration( + stats_config.get("retention", "%ds" % (sys.maxsize,)) ) def generate_config_section(self, config_dir_path, server_name, **kwargs): |