From 1fc5fdd52551542b90ea078cbaf923d64a3d70cd Mon Sep 17 00:00:00 2001 From: christianEQ Date: Wed, 17 Mar 2021 20:17:52 +0000 Subject: [PATCH] removed unused stuff from monkey Former-commit-id: be55daa6f7bcbf137b37269d1ee7a5fcacc14ff0 --- monkey/monkey.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/monkey/monkey.py b/monkey/monkey.py index 3c23874a8..a31b35f9b 100644 --- a/monkey/monkey.py +++ b/monkey/monkey.py @@ -1,17 +1,13 @@ -import keydb import random -import sched, time +import time import socket import asyncore import threading import argparse -import sys from pprint import pprint # Globals ops = {} -s = sched.scheduler(time.time, time.sleep) -g_exit = False numclients = 0 numkeys = 0 runtime = 0 @@ -208,16 +204,13 @@ def clear_ops(): def stats_thread(): global ops - global g_exit global runtime i = 0 - while not g_exit and not (runtime and i >= runtime): + while i < runtime or not runtime: time.sleep(1) 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() i += 1 - g_exit = True asyncore.close_all() def flush_db_sync(): @@ -253,8 +246,6 @@ def init_lpush(): handle_del_response(del_client) def main(test, flush): - global g_exit - clear_ops() if flush: @@ -272,7 +263,6 @@ def main(test, flush): threading.Thread(target=stats_thread).start() asyncore.loop() - g_exit = True print("Done.") parser = argparse.ArgumentParser(description="Test use cases for KeyDB.")