MCPcopy
hub / github.com/plotly/dash / _setup_timing

Method _setup_timing

dash/backends/_fastapi.py:144–159  ·  view source on GitHub ↗

Set up timing information for the request.

(self, request: Request)

Source from the content-addressed store, hash-verified

142 self._dev_tools_initialized = True
143
144 async def _setup_timing(self, request: Request) -> None:
145 """Set up timing information for the request."""
146 try:
147 request.state.json_body = (
148 await request.json()
149 if request.headers.get("content-type", "").startswith(
150 "application/json"
151 )
152 else None
153 )
154 except Exception: # pylint: disable=broad-exception-caught
155 request.state.json_body = None
156 if self.enable_timing:
157 request.state.timing_information = {
158 "__dash_server": {"dur": time.time(), "desc": None}
159 }
160
161 async def _run_before_hooks(self) -> None:
162 """Run all before-request hooks."""

Callers 1

__call__Method · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected