Time tracing setup for tracing the flow of data through AMP.

This commit is contained in:
Griatch 2015-09-17 21:56:14 +02:00
parent a4e081f11c
commit d02b781be1
7 changed files with 67 additions and 0 deletions

View file

@ -555,6 +555,8 @@ class ServerSessionHandler(SessionHandler):
Useful for connection handling messages.
"""
from evennia.server.profiling.timetrace import timetrace
text = timetrace(text, "ServerSessionHandler.data_out")
sessions = make_iter(session)
session = sessions[0]
text = text and to_str(to_unicode(text), encoding=session.encoding)
@ -599,6 +601,8 @@ class ServerSessionHandler(SessionHandler):
kwargs (any): Other data from protocol.
"""
from evennia.server.profiling.timetrace import timetrace
text = timetrace(text, "ServerSession.data_in")
session = self.sessions.get(sessid, None)
if session:
text = text and to_unicode(strip_control_sequences(text), encoding=session.encoding)