MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / stats_thread

Function stats_thread

monkey/monkey.py:205–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

203 ops = {'lpush': 0, 'blpop': 0, 'del': 0, 'scan': 0, 'set': 0, 'get': 0}
204
205def stats_thread():
206 global ops
207 global runtime
208 i = 0
209 while i < runtime or not runtime:
210 time.sleep(1)
211 print("Ops per second: " + str({k:v for (k,v) in ops.items() if v}))
212 clear_ops()
213 i += 1
214 asyncore.close_all()
215
216def flush_db_sync():
217 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

Callers

nothing calls this directly

Calls 2

printFunction · 0.85
clear_opsFunction · 0.85

Tested by

no test coverage detected