Measure outbound requests

This commit is contained in:
Erik Johnston 2018-09-14 15:11:26 +01:00
parent 941ac0f085
commit 9e2f9a7b57
1 changed files with 6 additions and 3 deletions

View File

@ -43,6 +43,7 @@ from synapse.api.errors import (
from synapse.http.endpoint import matrix_federation_endpoint
from synapse.util import logcontext
from synapse.util.logcontext import make_deferred_yieldable
from synapse.util.metrics import Measure
logger = logging.getLogger(__name__)
outbound_logger = logging.getLogger("synapse.http.outbound")
@ -224,6 +225,8 @@ class MatrixFederationHttpClient(object):
reactor=self.hs.get_reactor()
)
request_deferred.addTimeout(_sec_timeout, self.hs.get_reactor())
with Measure(self.clock, "outbound_request"):
response = yield make_deferred_yieldable(
request_deferred,
)