Bug 1898737 - Add telemetry for byte-range requests, and how often they're cacheable r=jesup,kershaw,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D212825
This commit is contained in:
@@ -56,6 +56,21 @@ netwerk:
|
||||
expires: never
|
||||
|
||||
network:
|
||||
byte_range_request:
|
||||
type: labeled_counter
|
||||
labels:
|
||||
- cacheable
|
||||
- not_cacheable
|
||||
description: >
|
||||
Counts of cacheable/non-cacheable byte-range requests
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1898737
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1898737
|
||||
notification_emails:
|
||||
- necko@mozilla.com
|
||||
expires: never
|
||||
|
||||
data_size_per_type:
|
||||
type: labeled_counter
|
||||
labels:
|
||||
|
||||
@@ -3749,7 +3749,17 @@ static bool IsSubRangeRequest(nsHttpRequestHead& aRequestHead) {
|
||||
if (NS_FAILED(aRequestHead.GetHeader(nsHttp::Range, byteRange))) {
|
||||
return false;
|
||||
}
|
||||
return !byteRange.EqualsLiteral("bytes=0-");
|
||||
|
||||
if (byteRange.EqualsLiteral("bytes=0-")) {
|
||||
#ifndef ANDROID
|
||||
glean::network::byte_range_request.Get("cacheable"_ns).Add(1);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#ifndef ANDROID
|
||||
glean::network::byte_range_request.Get("not_cacheable"_ns).Add(1);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult nsHttpChannel::OpenCacheEntry(bool isHttps) {
|
||||
|
||||
Reference in New Issue
Block a user