修改: PriceSystem/CalcSpeedMonitor.py

This commit is contained in:
罗干
2018-03-07 10:30:14 +08:00
parent 6256bb0edf
commit adda37f1ea
+3 -2
View File
@@ -2,9 +2,10 @@ import json
import multiprocessing import multiprocessing
import time import time
import redis import redis
import config
QUEUE = "calc_cmd" QUEUE = "calc_cmd"
redis_pool = redis.ConnectionPool(host='192.168.0.144', port=6379, db=0) redis_pool = redis.ConnectionPool(host=config.get_redis_host(), port=6379, db=1)
def monitor(pname): def monitor(pname):
@@ -12,7 +13,7 @@ def monitor(pname):
while True: while True:
pre_counter = client.llen(QUEUE) pre_counter = client.llen(QUEUE)
time.sleep(60) time.sleep(60)
print(pname + "#####################################:".zfill(100) + str( print(pname + "#########:".zfill(10) + str(
pre_counter - client.llen(QUEUE)) + "/min") pre_counter - client.llen(QUEUE)) + "/min")