[Checkins] SVN: zopyx.smartprintng.server/branches/multiprocessing/zopyx/smartprintng/server/models.py added concurrent request counts
Andreas Jung
andreas at andreas-jung.com
Thu Oct 8 12:16:27 EDT 2009
Log message for revision 104942:
added concurrent request counts
Changed:
U zopyx.smartprintng.server/branches/multiprocessing/zopyx/smartprintng/server/models.py
-=-
Modified: zopyx.smartprintng.server/branches/multiprocessing/zopyx/smartprintng/server/models.py
===================================================================
--- zopyx.smartprintng.server/branches/multiprocessing/zopyx/smartprintng/server/models.py 2009-10-08 16:13:56 UTC (rev 104941)
+++ zopyx.smartprintng.server/branches/multiprocessing/zopyx/smartprintng/server/models.py 2009-10-08 16:16:27 UTC (rev 104942)
@@ -25,6 +25,7 @@
def __init__(self):
self.num_requests = 0
+ self.concurrent_requests = 0
self.start_time = datetime.now()
self.delivery_max_age = 1800 # deliver files only younger than xx seconds
self.cleanup_after = 3600
@@ -46,6 +47,12 @@
self.num_requests += 1
self._lock.release()
+
+ def concurrentRequest(self, num):
+ self._lock.acquire()
+ self.concurrent_requests += num
+ self._lock.release()
+
@property
def start_time_as_str(self):
return self.start_time.strftime('%d.%m.%Y %H:%M:%S')
More information about the checkins
mailing list