Skip to content

Conversation

@tinitiuset
Copy link
Member

What this PR does

This PR is an update of #11178 that better reports added artificialDelay as part of the ServerTiming header on push requests.

Check out for reviewer's notes on the code:

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@tinitiuset tinitiuset requested a review from a team as a code owner April 21, 2025 10:10
d.sleep(pushReq.artificialDelay)
} else {
// Delay is configured but request is already taking longer than the delay
pushReq.artificialDelay = 0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reporting artificial delay for these cases is very important. 0 artificial delay means request is taking longer than configured artificial delay, worst case scenario.

r := &Request{
getRequest: p,
getRequest: p,
artificialDelay: -1,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

artificialDelay will be initialized to -1, because we want to use 0 as a value, so -1 would be the equivalent to "not set".

@dimitarvdimitrov
Copy link
Contributor

this made me realize that this PR doesn't document the header anywhere. Can you add it to the API reference and add a changelog entry too?

@dimitarvdimitrov
Copy link
Contributor

this made me realize that this PR doesn't document the header anywhere. Can you add it to the API reference and add a changelog entry too?

Martin pointed me to a previous discussion where Marco asked to not document this feature (yet?). We'll do the same now too

Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@dimitarvdimitrov dimitarvdimitrov merged commit a648e44 into main Apr 21, 2025
26 checks passed
@dimitarvdimitrov dimitarvdimitrov deleted the tinitiuset/report-artificial-latency branch April 21, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants