Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix queue time calculation #169

Merged
merged 6 commits into from
Mar 3, 2020
Merged

Fix queue time calculation #169

merged 6 commits into from
Mar 3, 2020

Conversation

asgrim
Copy link
Collaborator

@asgrim asgrim commented Feb 20, 2020

Fixes #163

@asgrim asgrim added the bug Something isn't working label Feb 20, 2020
@asgrim asgrim added this to the 4.0.2 milestone Feb 20, 2020
@asgrim asgrim requested a review from cschneid February 20, 2020 11:04
@dlanderson
Copy link

I don't think this will work; I'd like to make this more robust. Take a look at how we do it in our Python agent. It should be easy to port over. A few things to note:

  1. The headers can be any of X-Queue-Start X-Request-Start X-QUEUE-START X-REQUEST-START x-queue-start x-request-start
  2. The value of the header can start with t=, but not always.
  3. We can detect ambiguous values by anchoring a start date and comparing the values.

Copy link

@dlanderson dlanderson left a comment

Choose a reason for hiding this comment

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

See comment #169 (comment)

@asgrim
Copy link
Collaborator Author

asgrim commented Mar 3, 2020

@dlanderson

  1. The header matching is already case insensitive in PHP, so any of those values will work fine (the casing is applied consistently in \Scoutapm\Helper\FetchRequestHeaders::fromArray so the header names are deterministic here)
  2. Good catch, I missed that
  3. Interesting, all the docs I could find (which wasn't much!) on these headers was that they were always in milliseconds. I'll take a look into this 👍

@asgrim asgrim requested a review from dlanderson March 3, 2020 16:41
@cschneid cschneid merged commit 00aab45 into master Mar 3, 2020
@asgrim asgrim deleted the fix-queue-time-calculation branch September 9, 2020 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Queue time mismatch between X-Request-Time scale and start time call
3 participants