Bug 1421195 - Add telemetry probe for fraction of restyles that are parallel ; r=emilio

MozReview-Commit-ID: sVN7CWjgni
This commit is contained in:
Manish Goregaokar 2017-11-28 03:16:26 -08:00
parent c9afd2ae75
commit b92ab8df04
3 changed files with 23 additions and 0 deletions

View File

@ -65,6 +65,7 @@
#include "mozilla/StyleAnimationValue.h"
#include "mozilla/SystemGroup.h"
#include "mozilla/ServoMediaList.h"
#include "mozilla/Telemetry.h"
#include "mozilla/RWLock.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/ElementInlines.h"
@ -122,6 +123,17 @@ AssertIsMainThreadOrServoLangFontPrefsCacheLocked()
MOZ_ASSERT(NS_IsMainThread() || sServoFFILock->LockedForWritingByCurrentThread());
}
void
Gecko_RecordTraversalStatistics(uint32_t total, uint32_t parallel)
{
// we ignore cases where a page just didn't restyle a lot
if (total > 30) {
uint32_t percent = parallel * 100 / total;
Telemetry::Accumulate(Telemetry::STYLO_PARALLEL_RESTYLE_FRACTION, percent);
}
}
bool
Gecko_IsInDocument(RawGeckoNodeBorrowed aNode)
{

View File

@ -142,6 +142,7 @@ struct FontSizePrefs
};
// DOM Traversal.
void Gecko_RecordTraversalStatistics(uint32_t total, uint32_t parallel);
bool Gecko_IsInDocument(RawGeckoNodeBorrowed node);
bool Gecko_FlattenedTreeParentIsParent(RawGeckoNodeBorrowed node);
bool Gecko_IsSignificantChild(RawGeckoNodeBorrowed node,

View File

@ -13931,5 +13931,15 @@
"expires_in_version": "60",
"kind": "boolean",
"description": "Tracking how often scripts are loaded with a 'valid' version parameter. This telemetry ID helps us to decide if and when remove the support of script versioning."
},
"STYLO_PARALLEL_RESTYLE_FRACTION": {
"record_in_processes": ["content"],
"alert_emails": ["manish@mozilla.com"],
"expires_in_version": "60",
"kind": "linear",
"high": 100,
"n_buckets": 50,
"description": "Fraction of restyles on a single page that were parallel",
"bug_numbers": [1421195]
}
}