Measure Auth.check

pull/720/head
Erik Johnston 2016-04-13 11:15:59 +01:00
parent c53f9d561e
commit 0f2ca8cde1
1 changed files with 49 additions and 46 deletions

View File

@ -25,6 +25,7 @@ from synapse.api.errors import AuthError, Codes, SynapseError, EventSizeError
from synapse.types import Requester, RoomID, UserID, EventID
from synapse.util.logutils import log_function
from synapse.util.logcontext import preserve_context_over_fn
from synapse.util.metrics import Measure
from unpaddedbase64 import decode_base64
import logging
@ -44,6 +45,7 @@ class Auth(object):
def __init__(self, hs):
self.hs = hs
self.clock = hs.get_clock()
self.store = hs.get_datastore()
self.state = hs.get_state_handler()
self.TOKEN_NOT_FOUND_HTTP_STATUS = 401
@ -66,6 +68,7 @@ class Auth(object):
Returns:
True if the auth checks pass.
"""
with Measure(self.clock, "auth.check"):
self.check_size_limits(event)
if not hasattr(event, "room_id"):