Bug 1413512 -- Added a telemtry for counting of the HTTP redirection that triggered by top-level document or by subresource. r=schien data=francois

This commit is contained in:
Amy Chung 2017-12-15 10:50:19 -06:00
Родитель 331eac4d0a
Коммит d0eb2b7593
2 изменённых файлов: 33 добавлений и 7 удалений

Просмотреть файл

@ -119,6 +119,8 @@
//-----------------------------------------------------------------------------
using mozilla::Telemetry::LABELS_NETWORK_HTTP_REDIRECT_TO_SCHEME;
namespace mozilla {
namespace net {
@ -828,14 +830,28 @@ nsHttpHandler::AsyncOnChannelRedirect(nsIChannel* oldChan,
uint32_t flags,
nsIEventTarget* mainThreadEventTarget)
{
MOZ_ASSERT(NS_IsMainThread() && (oldChan && newChan));
nsCOMPtr<nsIURI> newURI;
newChan->GetURI(getter_AddRefs(newURI));
MOZ_ASSERT(newURI);
nsAutoCString scheme;
newURI->GetScheme(scheme);
MOZ_ASSERT(!scheme.IsEmpty());
Telemetry::AccumulateCategoricalKeyed(
scheme,
oldChan->IsDocument()
? LABELS_NETWORK_HTTP_REDIRECT_TO_SCHEME::topLevel
: LABELS_NETWORK_HTTP_REDIRECT_TO_SCHEME::subresource);
// TODO E10S This helper has to be initialized on the other process
RefPtr<nsAsyncRedirectVerifyHelper> redirectCallbackHelper =
new nsAsyncRedirectVerifyHelper();
return redirectCallbackHelper->Init(oldChan,
newChan,
flags,
mainThreadEventTarget);
return redirectCallbackHelper->Init(
oldChan, newChan, flags, mainThreadEventTarget);
}
/* static */ nsresult

Просмотреть файл

@ -2383,6 +2383,16 @@
"labels": ["NotSent", "CachedContentUsed", "CachedContentNotUsed"],
"description": "Stats for validation requests when cache won the race."
},
"NETWORK_HTTP_REDIRECT_TO_SCHEME" :{
"record_in_processes": ["main"],
"alert_emails": ["necko@mozilla.com", "seceng-telemetry@mozilla.com", "jkt@mozilla.com"],
"bug_numbers": [1413512],
"expires_in_version": "64",
"kind": "categorical",
"keyed": true,
"description": "Count of the HTTP redirection that triggered by top-level document or by subresource, keyed by the URL scheme redirected to.",
"labels": ["topLevel", "subresource"]
},
"HTTP_AUTH_DIALOG_STATS_3": {
"record_in_processes": ["main", "content"],
"expires_in_version": "61",