removed unused stuff from monkey

Former-commit-id: be55daa6f7bcbf137b37269d1ee7a5fcacc14ff0
This commit is contained in:
christianEQ 2021-03-17 20:17:52 +00:00
parent 31f8c6b63d
commit 1fc5fdd525

View File

@ -1,17 +1,13 @@
import keydb
import random import random
import sched, time import time
import socket import socket
import asyncore import asyncore
import threading import threading
import argparse import argparse
import sys
from pprint import pprint from pprint import pprint
# Globals # Globals
ops = {} ops = {}
s = sched.scheduler(time.time, time.sleep)
g_exit = False
numclients = 0 numclients = 0
numkeys = 0 numkeys = 0
runtime = 0 runtime = 0
@ -208,16 +204,13 @@ def clear_ops():
def stats_thread(): def stats_thread():
global ops global ops
global g_exit
global runtime global runtime
i = 0 i = 0
while not g_exit and not (runtime and i >= runtime): while i < runtime or not runtime:
time.sleep(1) time.sleep(1)
print("Ops per second: " + str({k:v for (k,v) in ops.items() if v})) print("Ops per second: " + str({k:v for (k,v) in ops.items() if v}))
#print(f"Blocked threads: {len(list(filter(lambda x: x.blocked, clients)))}")
clear_ops() clear_ops()
i += 1 i += 1
g_exit = True
asyncore.close_all() asyncore.close_all()
def flush_db_sync(): def flush_db_sync():
@ -253,8 +246,6 @@ def init_lpush():
handle_del_response(del_client) handle_del_response(del_client)
def main(test, flush): def main(test, flush):
global g_exit
clear_ops() clear_ops()
if flush: if flush:
@ -272,7 +263,6 @@ def main(test, flush):
threading.Thread(target=stats_thread).start() threading.Thread(target=stats_thread).start()
asyncore.loop() asyncore.loop()
g_exit = True
print("Done.") print("Done.")
parser = argparse.ArgumentParser(description="Test use cases for KeyDB.") parser = argparse.ArgumentParser(description="Test use cases for KeyDB.")