Bug 1468843 - Change telemetry to only record docgroup count for http(s). r=nika,data-review=chutten

Rename TOTAL_DOCGROUPS_PER_TABGROUP to
TOTAL_HTTP_DOCGROUPS_PER_TABGROUP, that collects telemetry for all
docgroups per tabgroup, but only for uris with http:// or https://
schemes.

Rename ACTIVE_DOCGROUPS_PER_TABGROUP to
ACTIVE_HTTP_DOCGROUPS_PER_TABGROUP, that collects telemetry for active
docgroups per tabgroup, but only for uris with http:// or https://
schemes.
This commit is contained in:
Andreas Farre 2018-06-26 00:20:00 +03:00
Родитель 10476f8e5b
Коммит 5d12791bb2
2 изменённых файлов: 26 добавлений и 12 удалений

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

@ -8399,18 +8399,32 @@ DispatchFullScreenChange(nsIDocument* aTarget)
static void ClearPendingFullscreenRequests(nsIDocument* aDoc);
static bool
HasHttpScheme(nsIURI* aURI)
{
bool isHttpish = false;
return aURI &&
((NS_SUCCEEDED(aURI->SchemeIs("http", &isHttpish)) && isHttpish) ||
(NS_SUCCEEDED(aURI->SchemeIs("https", &isHttpish)) && isHttpish));
}
void
nsIDocument::OnPageHide(bool aPersisted, EventTarget* aDispatchStartTarget)
{
if (mDocGroup && Telemetry::CanRecordExtended() &&
IsTopLevelContentDocument()) {
if (IsTopLevelContentDocument() && GetDocGroup() &&
Telemetry::CanRecordExtended()) {
TabGroup* tabGroup = mDocGroup->GetTabGroup();
if (tabGroup) {
Telemetry::Accumulate(Telemetry::ACTIVE_DOCGROUPS_PER_TABGROUP,
tabGroup->Count(true /* aActiveOnly */));
Telemetry::Accumulate(Telemetry::TOTAL_DOCGROUPS_PER_TABGROUP,
tabGroup->Count());
uint32_t active = tabGroup->Count(true /* aActiveOnly */);
uint32_t total = tabGroup->Count();
if (HasHttpScheme(GetDocumentURI())) {
Telemetry::Accumulate(Telemetry::ACTIVE_HTTP_DOCGROUPS_PER_TABGROUP,
active);
Telemetry::Accumulate(Telemetry::TOTAL_HTTP_DOCGROUPS_PER_TABGROUP,
total);
}
}
}

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

@ -13778,25 +13778,25 @@
"releaseChannelCollection": "opt-out",
"description": "Number of HTML editors whose inline table editing UI is actually used by users."
},
"ACTIVE_DOCGROUPS_PER_TABGROUP": {
"ACTIVE_HTTP_DOCGROUPS_PER_TABGROUP": {
"record_in_processes": ["content"],
"alert_emails": ["farre@mozilla.com"],
"bug_numbers": [1441972],
"bug_numbers": [1441972, 1468843],
"expires_in_version": "67",
"kind": "exponential",
"high": 50,
"n_buckets": 20,
"description": "Number of active doc groups per tab group. Collected at the point when the top level document of the tab group is unloaded."
"description": "Number of active http:// and https:// doc groups per tab group. Collected at the point when the top level document of the tab group is unloaded."
},
"TOTAL_DOCGROUPS_PER_TABGROUP": {
"TOTAL_HTTP_DOCGROUPS_PER_TABGROUP": {
"record_in_processes": ["content"],
"alert_emails": ["farre@mozilla.com"],
"bug_numbers": [1441972],
"bug_numbers": [1441972, 1468843],
"expires_in_version": "67",
"kind": "exponential",
"high": 50,
"n_buckets": 20,
"description": "Total number of doc groups per tab group, including docgroups fully in bfcache. Collected at the point when the top level document of the tab group is unloaded."
"description": "Total number of http:// and https:// doc groups per tab group, including docgroups fully in bfcache. Collected at the point when the top level document of the tab group is unloaded."
},
"HIDDEN_VIEWPORT_OVERFLOW_TYPE": {
"record_in_processes": ["content"],