Repository navigation
Report /check timings in Server-Timing - #155
Merged
Merged
Conversation
Shows in DevTools how much of a slow /check response is PHP startup, Psalm, or neither (network, server queue).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Since the playground redesign (#143),
/checkfeels slower. From outside,<?php echo 1;takes 2 to 8 s to answer, while the same request takes about 0.45 s locally, with either the Psalm commit before the deploy or the one now in production. Without server access there is no way to tell whether that time goes to Psalm, to PHP startup, or to waiting before PHP runs at all.Refs #0
Solution
/checknow sendsServer-Timing: boot;dur=…, analysis;dur=…, total;dur=…(milliseconds) on successful responses, shown in the DevTools Network tab under Timing:boot: fromREQUEST_TIME_FLOATto the start of the analysis (autoload, input checks)analysis:OnlineChecker::getResults(), or the cached homepage exampletotal: fromREQUEST_TIME_FLOATto just before the body is sentIf the browser's waiting time is much longer than
total, the delay happens before PHP starts handling the request (Apache workers, CPU contention, network), not in Psalm.The header carries only durations: no versions, paths or hostnames. No
Timing-Allow-Originis sent, so other origins cannot read the values. Error responses (400, 418, 422 and exceptions) do not get the header.