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

Collect appconnect_time in CurlFactory TransferStats #2284

Merged
merged 2 commits into from Apr 15, 2019
Merged

Collect appconnect_time in CurlFactory TransferStats #2284

merged 2 commits into from Apr 15, 2019

Conversation

1ma
Copy link
Contributor

@1ma 1ma commented Apr 10, 2019

Context

For some historical reason the original implementation of curl_getinfo($ch) did not include the appconect_time metric and wasn't available until PHP 5.5.0, where it can be retrieved separatedly by passing the CURLINFO_APPCONNECT_TIME constant as the second parameter of curl_getinfo($ch, $opt). appconnect_time is the time it takes cURL to negotiate the TLS handshake with the server after it establishes a TCP connection.

This PR records appconnect_time into the TransferStats::$handlerStats array, so it can be read and used in on_stats callables.

References

https://www.php.net/manual/en/function.curl-getinfo.php#refsect1-function.curl-getinfo-changelog
https://curl.haxx.se/libcurl/c/CURLINFO_APPCONNECT_TIME.html
http://docs.guzzlephp.org/en/stable/request-options.html#on-stats

@sergiodebcn
Copy link

sergiodebcn commented Apr 10, 2019

It would be nice to merge this

@sagikazarmark
Copy link
Member

@1ma thanks! Can you please rebase your branch?

@1ma
Copy link
Contributor Author

1ma commented Apr 15, 2019

Yup, done.

@sagikazarmark sagikazarmark self-requested a review April 15, 2019 08:20
Copy link
Member

@sagikazarmark sagikazarmark left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @1ma

@sagikazarmark sagikazarmark merged commit bf59542 into guzzle:master Apr 15, 2019
@1ma 1ma deleted the collect_appconnect_time branch April 15, 2019 08:45
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.

None yet

3 participants