in scripts/weather_perf.py [0:0]
def progress_func():
# Specify that query_count is a global variable
global query_count
global lock
# Start timing
start_time = time.time()
initial = True
count=0
# Loop indefinitely
while True:
if initial != True:
# Format an output string
end_time = time.time()
output = "Q/s: {0}\r ".format(int(query_count / (end_time-start_time)))
start_time = end_time
# Reset the executed query count
with lock:
query_count = 0
# Write to STDOUT and flush
sys.stdout.write(output)
sys.stdout.flush()
# Sleep this thread for .5 second
time.sleep(.5)
# No longer initial pass
initial = False