{#- The Timing panel: the request's phases as spans on its clock, each drawn as a bar placed where it starts and as wide as it lasts. -#} {%- set total = panel.spans[0].duration_ms if panel.spans else 0 -%} {%- macro bar(span) -%} {%- set from = [[(span.start_ms * 100 / total)|round|int, 0]|max, 100]|min if total > 0 else 0 -%} {%- set width = [[(span.duration_ms * 100 / total)|round|int, 0]|max, 100 - from]|min if total > 0 else 0 -%} {%- endmacro -%} {%- for span in panel.spans recursive %} {%- if span.children %}{{ loop(span.children) }}{% endif %} {%- endfor %}
PhaseStartsTakesOn the request's clock
{{ span.name }} {{ span.start_ms|round(2) }} ms {{ span.duration_ms|round(2) }} ms {{ bar(span) }}
{%- for table in panel.tables %} {%- for row in table.rows %} {%- endfor %}
{{ table.caption }}
{{ row.cells[0] }}{{ row.cells[1] }}
{%- endfor %} {%- if not panel.spans %}

No times are known yet.

{%- else %}
What the phases are
request
From the request's arrival at Muru until the last byte of its response was sent.
waiting for a worker
Until a worker was free to take the request.
until the response head
From handing the request to the worker until the response's status and headers came back from it.
sending the response
From then until the last byte was sent to the client.
in the worker
The worker's own account, from receiving the request until the application was done with it.
until the response starts
Until the application called start_response, or sent http.response.start.
producing the body
From the body's first byte to its last.
finishing
Until the body's close() returned, or the ASGI application returned.
waiting for a thread
From the worker taking a WSGI request until one of its threads started it.
waiting for the GIL
As that thread, or the event loop, started running Python for the request. The table gives every wait the request had, and garbage collections, which pause every thread of the worker.
event loop held
The longest stretch during the request in which the worker's event loop did not get to run: it was blocked, by this request or another.
{%- endif %} {%- for value in panel.values %}

The {{ value.name }} {% if value.value == "still to come" %}is still to come.{% else %}{{ value.value }}.{% endif %}

{%- endfor %}