MCPcopy
hub / github.com/aio-libs/aiohttp / Trace

Class Trace

aiohttp/tracing.py:318–453  ·  view source on GitHub ↗

Internal dependency holder class. Used to keep together the main dependencies used at the moment of send a signal.

Source from the content-addressed store, hash-verified

316
317
318class Trace:
319 """Internal dependency holder class.
320
321 Used to keep together the main dependencies used
322 at the moment of send a signal.
323 """
324
325 def __init__(
326 self,
327 session: "ClientSession",
328 trace_config: TraceConfig,
329 trace_config_ctx: SimpleNamespace,
330 ) -> None:
331 self._trace_config = trace_config
332 self._trace_config_ctx = trace_config_ctx
333 self._session = session
334
335 async def send_request_start(
336 self, method: str, url: URL, headers: "CIMultiDict[str]"
337 ) -> None:
338 return await self._trace_config.on_request_start.send(
339 self._session,
340 self._trace_config_ctx,
341 TraceRequestStartParams(method, url, headers),
342 )
343
344 async def send_request_chunk_sent(
345 self, method: str, url: URL, chunk: bytes
346 ) -> None:
347 return await self._trace_config.on_request_chunk_sent.send(
348 self._session,
349 self._trace_config_ctx,
350 TraceRequestChunkSentParams(method, url, chunk),
351 )
352
353 async def send_response_chunk_received(
354 self, method: str, url: URL, chunk: bytes
355 ) -> None:
356 return await self._trace_config.on_response_chunk_received.send(
357 self._session,
358 self._trace_config_ctx,
359 TraceResponseChunkReceivedParams(method, url, chunk),
360 )
361
362 async def send_request_end(
363 self,
364 method: str,
365 url: URL,
366 headers: "CIMultiDict[str]",
367 response: ClientResponse,
368 ) -> None:
369 return await self._trace_config.on_request_end.send(
370 self._session,
371 self._trace_config_ctx,
372 TraceRequestEndParams(method, url, headers, response),
373 )
374
375 async def send_request_exception(

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…