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

Defer EventListener events until bytes are returned #5670

Merged
merged 1 commit into from
Dec 30, 2019

Conversation

swankjesse
Copy link
Collaborator

This changes the timing of responseHeaderStart and responseBodyStart events to
fire when bytes are received from the server. This is a non-trivial behavior
change and should be documented as such in the release notes. In particular,
the responseFailed event may be fired without a preceding responseHeadersStart
event.

To test this I've added a timestamp to our CallEvent test facet.

Closes: #5578

eventSequence.clear()
while (eventSequence.isNotEmpty()) {
takeEvent()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the difference here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I need to call takeEvent() so the lastTimestampNs is updated.

assertTrue(noCloses)
} else {
fail("close without open")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is just

assertTrue("close without open", noCloses)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, thanks. (I exploded that into 5 lines to set breakpoints and forgot to roll back!)

@swankjesse swankjesse force-pushed the jwilson.1230.time_to_first_byte branch 2 times, most recently from 1eea6e2 to a1cf78f Compare December 30, 2019 18:04
This changes the timing of responseHeaderStart and responseBodyStart events to
fire when bytes are received from the server. This is a non-trivial behavior
change and should be documented as such in the release notes. In particular,
the responseFailed event may be fired without a preceding responseHeadersStart
event.

To test this I've added a timestamp to our CallEvent test facet.

Closes: #5578
@swankjesse swankjesse force-pushed the jwilson.1230.time_to_first_byte branch from a1cf78f to 53d2d79 Compare December 30, 2019 18:11
@swankjesse swankjesse merged commit 975be25 into master Dec 30, 2019
@swankjesse swankjesse deleted the jwilson.1230.time_to_first_byte branch January 1, 2020 19:42
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.

TTFB and responseHeadersStart being called too soon
3 participants