[Zodb-checkins] CVS: Zope/lib/python/ZODB - ActivityMonitor.py:1.4

Shane Hathaway shane@cvs.zope.org
Wed, 9 Oct 2002 11:11:56 -0400


Update of /cvs-repository/Zope/lib/python/ZODB
In directory cvs.zope.org:/tmp/cvs-serv25287/ZODB

Modified Files:
	ActivityMonitor.py 
Log Message:
The database activity chart now shows the number of connections in a period
in addition to the loads and stores.


=== Zope/lib/python/ZODB/ActivityMonitor.py 1.3 => 1.4 ===
--- Zope/lib/python/ZODB/ActivityMonitor.py:1.3	Wed Aug 14 18:07:09 2002
+++ Zope/lib/python/ZODB/ActivityMonitor.py	Wed Oct  9 11:11:25 2002
@@ -72,12 +72,14 @@
                 'end': start + (end - start) * (n + 1) / divisions,
                 'loads': 0,
                 'stores': 0,
+                'connections': 0,
                 })
 
         div = res[0]
         div_start = div['start']
         div_end = div['end']
         div_index = 0
+        connections = 0
         total_loads = 0
         total_stores = 0
         for t, loads, stores in self.log:
@@ -90,17 +92,21 @@
             while t > div_end:
                 div['loads'] = total_loads
                 div['stores'] = total_stores
+                div['connections'] = connections
                 total_loads = 0
                 total_stores = 0
+                connections = 0
                 div_index = div_index + 1
                 if div_index < divisions:
                     div = res[div_index]
                     div_start = div['start']
                     div_end = div['end']
+            connections = connections + 1
             total_loads = total_loads + loads
             total_stores = total_stores + stores
 
         div['stores'] = div['stores'] + total_stores
         div['loads'] = div['loads'] + total_loads
+        div['connections'] = div['connections'] + connections
 
         return res