From 0a79af322e06c66273fcc1a1ce4ce2a008e096a6 Mon Sep 17 00:00:00 2001 From: wangwenyan Date: Tue, 13 Mar 2018 15:16:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9D=87=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PriceSystem/CalcCmdSender.py | 2 +- PriceSystem/CalcSpeedMonitor.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/PriceSystem/CalcCmdSender.py b/PriceSystem/CalcCmdSender.py index 747cd88..671bfa6 100644 --- a/PriceSystem/CalcCmdSender.py +++ b/PriceSystem/CalcCmdSender.py @@ -22,7 +22,7 @@ class CJsonEncoder(json.JSONEncoder): QUEUE = "calc_cmd" redisPool = redis.ConnectionPool(host=config.get_redis_host(), port=6379, db=config.get_redis_db()) client = redis.Redis(connection_pool=redisPool) -logger = fangjia.get_logger("CalcCmdReceiver") +logger = fangjia.get_logger("CalcCmdSender") def get_district(city): diff --git a/PriceSystem/CalcSpeedMonitor.py b/PriceSystem/CalcSpeedMonitor.py index 715f423..5049b3b 100644 --- a/PriceSystem/CalcSpeedMonitor.py +++ b/PriceSystem/CalcSpeedMonitor.py @@ -3,10 +3,13 @@ import multiprocessing import time import redis import config +import fangjia QUEUE = "calc_cmd" redis_pool = redis.ConnectionPool(host=config.get_redis_host(), port=6379, db=config.get_redis_db()) +logger = fangjia.get_logger("CalcSpeedMonitor") + def monitor(pname): client = redis.Redis(connection_pool=redis_pool) @@ -14,7 +17,7 @@ def monitor(pname): pre_counter = client.llen(QUEUE) time.sleep(60) now_counter = client.llen(QUEUE) - print(pname + "#########:".zfill(100) + str(pre_counter - now_counter) + "/min") + logger.info(pname + "#####:".zfill(20) + str(pre_counter - now_counter) + "/min") def format_cmd(cmd):