[Neo-report] r2008 vincent - in /trunk/neo: client/app.py connection.py event.py protocol.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Apr 22 17:55:04 CEST 2010
Author: vincent
Date: Thu Apr 22 17:55:02 2010
New Revision: 2008
Log:
More profiling decorators.
Modified:
trunk/neo/client/app.py
trunk/neo/connection.py
trunk/neo/event.py
trunk/neo/protocol.py
Modified: trunk/neo/client/app.py
==============================================================================
--- trunk/neo/client/app.py [iso-8859-1] (original)
+++ trunk/neo/client/app.py [iso-8859-1] Thu Apr 22 17:55:02 2010
@@ -1015,6 +1015,7 @@
return history_list
+ @profiler_decorator
def importFrom(self, source, start, stop, tryToResolveConflict):
serials = {}
def updateLastSerial(oid, result):
Modified: trunk/neo/connection.py
==============================================================================
--- trunk/neo/connection.py [iso-8859-1] (original)
+++ trunk/neo/connection.py [iso-8859-1] Thu Apr 22 17:55:02 2010
@@ -86,6 +86,7 @@
def getHandler(self):
return self._pending[0][1]
+ @profiler_decorator
def emit(self, request):
# register the request in the current handler
_pending = self._pending
@@ -97,6 +98,7 @@
assert msg_id not in request_dict, "Packet id already expected"
request_dict[msg_id] = answer_class
+ @profiler_decorator
def handle(self, packet):
assert len(self._pending) == 1 or self._pending[0][0]
PACKET_LOGGER.dispatch(self._connection, packet, 'from')
@@ -121,6 +123,7 @@
del self._pending[0]
logging.debug('Apply handler %r', self._pending[0][1])
+ @profiler_decorator
def setHandler(self, handler):
if len(self._pending) == 1 and not self._pending[0][0]:
# nothing is pending, change immediately
@@ -601,6 +604,7 @@
finally:
self.unlock()
+ @profiler_decorator
def ask(self, packet, timeout=CRITICAL_TIMEOUT):
self.lock()
try:
Modified: trunk/neo/event.py
==============================================================================
--- trunk/neo/event.py [iso-8859-1] (original)
+++ trunk/neo/event.py [iso-8859-1] Thu Apr 22 17:55:02 2010
@@ -18,6 +18,7 @@
from time import time
from neo.epoll import Epoll
+from neo.profiling import profiler_decorator
class EpollEventManager(object):
"""This class manages connections and events based on epoll(5)."""
@@ -173,6 +174,7 @@
self.reader_set.remove(fd)
self.epoll.modify(fd, 0, fd in self.writer_set)
+ @profiler_decorator
def addWriter(self, conn):
connector = conn.getConnector()
assert connector is not None, conn.whoSetConnector()
Modified: trunk/neo/protocol.py
==============================================================================
--- trunk/neo/protocol.py [iso-8859-1] (original)
+++ trunk/neo/protocol.py [iso-8859-1] Thu Apr 22 17:55:02 2010
@@ -209,6 +209,7 @@
raise PacketMalformedError("can't read string <%s>" % name)
return (string, buf[offset+4+size:])
+ at profiler_decorator
def _encodeString(buf):
return pack('!L', len(buf)) + buf
@@ -272,6 +273,7 @@
return (pack(PACKET_HEADER_FORMAT, self._id, self._code, length),
content)
+ @profiler_decorator
def __len__(self):
return PACKET_HEADER_SIZE + len(self._body)
@@ -881,6 +883,7 @@
"""
_header_format = '!8s8s8sBL'
+ @profiler_decorator
def _encode(self, oid, serial, compression, checksum, data, tid):
if serial is None:
serial = INVALID_TID
More information about the Neo-report
mailing list