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 incorrect tracing of corner case HTTP requests #862

Merged
merged 4 commits into from
Dec 7, 2018
Merged

Conversation

na--
Copy link
Member

@na-- na-- commented Dec 7, 2018

Some details:

  • Before this, some of the measured metrics could be negative, or in one case - hugely positive (saving a timestamp instead of a duration)...
  • The changes were first developed and tested in this debug branch. There's still a bit of debug code left here, to test if I've transferred all of the changes from the debug branch correctly. I'll remove it before squashing and merging this PR in `master.
  • Long term, it seems that a rewrite of the Tracer would be needed, since using atomics to measure these metrics isn't flexible enough. It's practically impossible to measure times correctly when the standard library decides to retry an HTTP/2 request... :/ These fixes will work for now, but I'll create a new issue about it.

This should fix #588 for good.

na-- added 2 commits December 7, 2018 09:56
Some details:
- Before this, some of the measured metrics could be negative, or in one case - hugely positive (saving a timestamp instead of a duration)...
- The changes were first developed and tested in this debug branch: https://github.com/na--/k6/tree/debug-neg-http-measurements
- Long term, it seems that a rewrite would be needed, since using atomics to measure these metrics isn't flexible enough. It's practically impossible to measure times correctly when the standard library decides to retry an HTTP/2 request :/
@na-- na-- requested a review from mstoykov December 7, 2018 08:11
@codecov-io
Copy link

codecov-io commented Dec 7, 2018

Codecov Report

Merging #862 into master will increase coverage by 0.03%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #862      +/-   ##
==========================================
+ Coverage   70.09%   70.12%   +0.03%     
==========================================
  Files         111      111              
  Lines        8720     8736      +16     
==========================================
+ Hits         6112     6126      +14     
- Misses       2214     2215       +1     
- Partials      394      395       +1
Impacted Files Coverage Δ
lib/netext/tracer.go 96.39% <91.66%> (-1.5%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7cfe26...03a8076. Read the comment docs.

Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

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

just some typos
I'm not against leaving the debug log just asking

lib/netext/tracer.go Outdated Show resolved Hide resolved
lib/netext/tracer.go Outdated Show resolved Hide resolved
Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

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

LGTM

@na-- na-- merged commit 6d30281 into master Dec 7, 2018
@na-- na-- deleted the fix-http-tracing branch December 7, 2018 10: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.

Negative http_req_sending values
3 participants