[Commits] (vajda) - fixed items per second committed to commit log
message for windows
commits at osafoundation.org
commits at osafoundation.org
Thu Oct 28 13:18:25 PDT 2004
Commit by: vajda
Modified files:
chandler/repository/item/Values.py 1.23 1.24
chandler/repository/persistence/XMLRepositoryView.py 1.67 1.68
Log message:
- fixed items per second committed to commit log message for windows
- fixed merge bug found by Brian
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/repository/item/Values.py.diff?r1=text&tr1=1.23&r2=text&tr2=1.24
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/XMLRepositoryView.py.diff?r1=text&tr1=1.67&r2=text&tr2=1.68
Index: chandler/repository/item/Values.py
diff -u chandler/repository/item/Values.py:1.23 chandler/repository/item/Values.py:1.24
--- chandler/repository/item/Values.py:1.23 Mon Oct 25 18:28:57 2004
+++ chandler/repository/item/Values.py Thu Oct 28 13:18:23 2004
@@ -1,6 +1,6 @@
-__revision__ = "$Revision: 1.23 $"
-__date__ = "$Date: 2004/10/26 01:28:57 $"
+__revision__ = "$Revision: 1.24 $"
+__date__ = "$Date: 2004/10/28 20:18:23 $"
__copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -423,8 +423,9 @@
def _unloadValue(self, name, other, otherName):
- self._unloadRef(name, other, otherName)
- other._references._unloadRef(otherName, self._item, name)
+ if not (other is None or other._isUUID()):
+ self._unloadRef(name, other, otherName)
+ other._references._unloadRef(otherName, self._item, name)
def _unloadRef(self, name, other, otherName):
Index: chandler/repository/persistence/XMLRepositoryView.py
diff -u chandler/repository/persistence/XMLRepositoryView.py:1.67 chandler/repository/persistence/XMLRepositoryView.py:1.68
--- chandler/repository/persistence/XMLRepositoryView.py:1.67 Thu Oct 28 10:27:05 2004
+++ chandler/repository/persistence/XMLRepositoryView.py Thu Oct 28 13:18:23 2004
@@ -1,10 +1,11 @@
-__revision__ = "$Revision: 1.67 $"
-__date__ = "$Date: 2004/10/28 17:27:05 $"
+__revision__ = "$Revision: 1.68 $"
+__date__ = "$Date: 2004/10/28 20:18:23 $"
__copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
-from datetime import datetime
+from datetime import timedelta
+from time import time
from struct import pack
from cStringIO import StringIO
@@ -185,13 +186,13 @@
newVersion, item)
self.find(item._uuid)
- before = datetime.now()
+ before = time()
count = len(histNotifications)
histNotifications.dispatchHistory(self)
- delta = datetime.now() - before
- if delta.seconds > 1:
+ duration = time() - before
+ if duration > 1.0:
self.logger.warning('%s %d notifications ran in %s',
- self, count, delta)
+ self, count, timedelta(seconds=duration))
self.prune(10000)
@@ -205,7 +206,7 @@
store = self.repository.store
history = store._history
- before = datetime.now()
+ before = time()
size = 0L
txnStarted = False
@@ -273,12 +274,17 @@
self._roots._clearDirties()
self.setDirty(0)
- after = datetime.now()
+ after = time()
if count > 0:
- self.logger.info('%s committed %d items (%ld bytes) in %s',
- self, count, size, after - before)
-
+ duration = after - before
+ try:
+ speed = ", %d/s" % round(count / duration)
+ except ZeroDivisionError:
+ speed = ' (speed could not be measured)'
+ self.logger.info('%s committed %d items (%ld bytes) in %s%s',
+ self, count, size,
+ timedelta(seconds=duration), speed)
if len(self._notifications) > 0:
histNotifications = RepositoryNotifications()
More information about the Commits
mailing list