From 39ec135ed3f00fc5c00a19bd669de8231f2c13e7 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 9 Sep 2015 17:00:36 -0400 Subject: [PATCH] Revert "debug stats about threads" This reverts commit 9b2c9c2fd39c2dd6f694815aa36d180efaa406d5. --- poller-service.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/poller-service.py b/poller-service.py index 25da75edd5..f724dffe46 100755 --- a/poller-service.py +++ b/poller-service.py @@ -236,7 +236,7 @@ devices_scanned = 0 def poll_worker(): global dev_query global devices_scanned - thread_id = threading.current_thread().name + thread_id = threading.current_thread().ident db = DB() while True: dev_row = db.query(dev_query) @@ -282,7 +282,6 @@ def poll_worker(): log.debug("DEBUG: Thread {0} finished {1} of device {2} in {3} seconds".format(thread_id, action, device_id, elapsed_time)) else: log.warning("WARNING: Thread {0} finished {1} of device {2} in {3} seconds".format(thread_id, action, device_id, elapsed_time)) - thread_stats[thread_id]['last_completed_poll'] = datetime.now() except (KeyboardInterrupt, SystemExit): raise except: @@ -291,11 +290,8 @@ def poll_worker(): releaseLock('{0}.{1}'.format(action, device_id), db) -thread_stats = {} for i in range(0, amount_of_workers): - thread_stats[i] = {} t = threading.Thread(target=poll_worker) - t.name = i t.daemon = True t.start() @@ -303,9 +299,6 @@ for i in range(0, amount_of_workers): while True: sleep_until(next_update) - for thread, data in thread_stats.iteritems(): - log.debug('DEBUG: Thread {0} last completed at {1}'.format(thread, data['last_completed_poll'])) - seconds_taken = (datetime.now() - (next_update - timedelta(minutes=1))).seconds update_query = ('INSERT INTO pollers(poller_name, ' ' last_polled, '