Bug 188391 - [Curl] Surface additional NetworkLoadMetrics
Summary: [Curl] Surface additional NetworkLoadMetrics
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-08-07 14:57 PDT by Don Olmstead
Modified: 2018-08-08 18:13 PDT (History)
9 users (show)

See Also:


Attachments
Patch (6.29 KB, patch)
2018-08-07 15:17 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (5.79 KB, patch)
2018-08-07 15:19 PDT, Don Olmstead
joepeck: review+
Details | Formatted Diff | Diff
Patch (5.83 KB, patch)
2018-08-08 17:27 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Olmstead 2018-08-07 14:57:40 PDT
Currently a few network load metrics are missing in the curl port.
Comment 1 Don Olmstead 2018-08-07 15:17:05 PDT
Created attachment 346737 [details]
Patch
Comment 2 Don Olmstead 2018-08-07 15:19:19 PDT
Created attachment 346738 [details]
Patch
Comment 3 Joseph Pecoraro 2018-08-07 15:40:06 PDT
Comment on attachment 346738 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=346738&action=review

Nice! r=me

You may be able to enable a few of the Inspector LayoutTests. Namely:
LayoutTests/http/tests/inspector/network/resource-sizes-network.html

> Source/WebCore/platform/network/curl/CurlContext.cpp:739
> +    long protocol;

This appears to be unused and can be removed.

> Source/WebCore/platform/network/curl/CurlContext.cpp:761
> +    errorCode = curl_easy_getinfo(m_handle, CURLINFO_REQUEST_SIZE, &requestHeaderSize);

Can you subtract out the requestBodySize to get requestHeaderSize closer to the actual value? You'd want to do some sanity checking to see if that makes sense.

> Source/WebCore/platform/network/curl/CurlContext.cpp:773
> +    errorCode = curl_easy_getinfo(m_handle, CURLINFO_SIZE_DOWNLOAD_T, &responseBodySize);

Same here, does this include the Header Size or not? The curl docs did not seem clear to me.
Comment 4 Basuke Suzuki 2018-08-08 17:02:54 PDT
Comment on attachment 346738 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=346738&action=review

> Source/WebCore/platform/network/curl/CurlContext.cpp:82
> +static const ASCIILiteral http20Protocol { "h2"_s };

constant should be named like kHttpProtocol10, kHttpProtocol11, kHttpProtocol2. Also version number of HTTP/2 is just 2, not 2.0. https://http2.github.io/faq/#is-it-http20-or-http2

>> Source/WebCore/platform/network/curl/CurlContext.cpp:761
>> +    errorCode = curl_easy_getinfo(m_handle, CURLINFO_REQUEST_SIZE, &requestHeaderSize);
> 
> Can you subtract out the requestBodySize to get requestHeaderSize closer to the actual value? You'd want to do some sanity checking to see if that makes sense.

Write. Request size includes entire size (header + body). I confirmed that by reading code for libcurl.

>> Source/WebCore/platform/network/curl/CurlContext.cpp:773
>> +    errorCode = curl_easy_getinfo(m_handle, CURLINFO_SIZE_DOWNLOAD_T, &responseBodySize);
> 
> Same here, does this include the Header Size or not? The curl docs did not seem clear to me.

This doesn't include the header size.
Comment 5 Basuke Suzuki 2018-08-08 17:03:34 PDT
> Write.

I mean "Right". :(
Comment 6 Don Olmstead 2018-08-08 17:27:55 PDT
Created attachment 346805 [details]
Patch

Updated based on review feedback.
Comment 7 WebKit Commit Bot 2018-08-08 18:12:12 PDT
Comment on attachment 346805 [details]
Patch

Clearing flags on attachment: 346805

Committed r234715: <https://trac.webkit.org/changeset/234715>
Comment 8 WebKit Commit Bot 2018-08-08 18:12:13 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2018-08-08 18:13:33 PDT
<rdar://problem/43073623>