dragonfly/tools/benchmark_checks.py
adiholden 6e32139ada
Benchmark runner (#2780)
* feat(github runner): add benchmark workflow

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-03-27 07:31:19 +00:00

23 lines
595 B
Python

#!/usr/bin/env python3
import redis
import re
def main():
max_unaccounted = 200 * 1024 * 1024 # 200mb
client = redis.Redis(decode_responses=True)
info = client.info("memory")
print(f'Used memory {info["used_memory"]}, rss {info["used_memory_rss"]}')
assert info["used_memory_rss"] - info["used_memory"] < max_unaccounted
info = client.info("replication")
assert info["role"] == "master"
replication_state = info["slave0"]
assert replication_state["lag"] == 0
assert replication_state["state"] == "stable_sync"
if __name__ == "__main__":
main()