From 23c51b944c0bf3e7859321b103769838dd42c7ea Mon Sep 17 00:00:00 2001 From: Jorrit Schaap <schaap@astron.nl> Date: Mon, 19 Oct 2015 12:10:11 +0000 Subject: [PATCH] Task #8291: logging --- LTA/ltastorageoverview/lib/scraper.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/LTA/ltastorageoverview/lib/scraper.py b/LTA/ltastorageoverview/lib/scraper.py index 6ad817dabdc..f03baa13bba 100755 --- a/LTA/ltastorageoverview/lib/scraper.py +++ b/LTA/ltastorageoverview/lib/scraper.py @@ -347,8 +347,6 @@ def main(argv): '''returns the total number of parallel running ResultGetterThreads''' return sum([len(v) for v in getters.values()]) - logger.info('numLocationsInQueues=%d' % numLocationsInQueues()) - # only enter main loop if there is anything to process if numLocationsInQueues() > 0: @@ -364,16 +362,12 @@ def main(argv): for finishedGetter in finishedGetterList: getters[site_name].remove(finishedGetter) - logger.info('numLocationsInQueues=%d totalNumGetters=%d' % (numLocationsInQueues(), totalNumGetters())) - # spawn new ResultGetterThreads # do not overload this host system while numLocationsInQueues() > 0 and (totalNumGetters() <= 4 or (os.getloadavg()[0] < 3*multiprocessing.cpu_count() and totalNumGetters() < 2*multiprocessing.cpu_count())): - logger.info('numLocationsInQueues=%d totalNumGetters=%d' % (numLocationsInQueues(), totalNumGetters())) - with lock: sitesStats = db.visitStats(datetime.datetime.utcnow() - datetime.timedelta(days=1)) @@ -412,6 +406,8 @@ def main(argv): newGetter.start() getters[chosen_site_name].append(newGetter) + logger.info('numLocationsInQueues=%d totalNumGetters=%d' % (numLocationsInQueues(), totalNumGetters())) + # small sleep between starting multiple getters time.sleep(0.25) -- GitLab