Author: croberts Date: 2012-10-17 19:20:29 +0000 (Wed, 17 Oct 2012) New Revision: 5513
Modified: trunk/cumin/python/cumin/stat.py Log: Reverting change that spun-up threads to allow simultaneous database queries. This seems to be leaking database connections.
Modified: trunk/cumin/python/cumin/stat.py =================================================================== --- trunk/cumin/python/cumin/stat.py 2012-10-17 19:07:06 UTC (rev 5512) +++ trunk/cumin/python/cumin/stat.py 2012-10-17 19:20:29 UTC (rev 5513) @@ -2,7 +2,6 @@ import logging from datetime import datetime, timedelta from time import time, sleep -import threading
from wooly import Widget, Page, Parameter, Attribute from wooly.util import StringCatalog, escape_entity, Writer @@ -1016,16 +1015,9 @@
samples[stat] = ns else: - threads = [] for i, stat in enumerate(stats): - # start a thread to do the db query, etc for each stat requested - threads.append(threading.Thread(target = self.getStatSamples, args = (adapter, samples, stat, dur, interval, method, end_seconds_ago, delta))) - threads[i].start() - - for th in threads: - while th.isAlive(): - pass - + self.getStatSamples(adapter, samples, stat, dur, interval, method, end_seconds_ago, delta) + return samples
def get_max_min(self, session, stats, samples, time_span=99999, end_seconds_ago=0):