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

@ -228,6 +228,9 @@ class ServerSession(Session):
kwargs (any): Other parameters from the protocol.
"""
from evennia.server.profiling.timetrace import timetrace
text = timetrace(text, "ServerSession.data_in")
#explicitly check for None since text can be an empty string, which is
#also valid
if text is not None:
@ -260,6 +263,9 @@ class ServerSession(Session):
kwargs (any): Other parameters to the protocol.
"""
from evennia.server.profiling.timetrace import timetrace
text = timetrace(text, "ServerSession.data_out")
text = text if text else ""
if _INLINEFUNC_ENABLED and not "raw" in kwargs:
text = parse_inlinefunc(text, strip="strip_inlinefunc" in kwargs, session=self)