0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 18:26:15 +01:00
posthog/ee/clickhouse/test/test_system_status.py
Karl-Aksel Puulmann 2b42909591
Show clickhouse disk and system.stats on /instance/status (#4042)
* Show clickhouse disk and system.stats on /instance/status

Part of https://github.com/PostHog/vpc/issues/45

* Show stats on clickhouse table sizes, remove postgres table size stats

* Add metric for whether clickhouse is alive

* Move clickhouse stats above redis
2021-04-22 08:46:29 +03:00

15 lines
456 B
Python

from ee.clickhouse.system_status import system_status
def test_system_status(db):
results = list(system_status())
assert [row["key"] for row in results] == [
"clickhouse_alive",
"clickhouse_disk_0_free_space",
"clickhouse_disk_0_total_space",
"clickhouse_table_sizes",
"clickhouse_system_metrics",
]
assert len(results[-2]["subrows"]["rows"]) > 0
assert len(results[-1]["subrows"]["rows"]) > 0