Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1644)

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2533783003: Add metrics for style update time before FCP. (Closed)
Patch Set: value_or(base::TimeDelta()) Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index f5972c64070085e883e96563363867652c7fe6a3..42017d38270e34474b748d9ed816d1bdb4482aa4 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -56,6 +56,7 @@
#include "core/css/CSSFontSelector.h"
#include "core/css/CSSStyleDeclaration.h"
#include "core/css/CSSStyleSheet.h"
+#include "core/css/CSSTiming.h"
#include "core/css/FontFaceSet.h"
#include "core/css/MediaQueryMatcher.h"
#include "core/css/PropertyRegistry.h"
@@ -2009,7 +2010,7 @@ void Document::updateActiveStyle() {
void Document::updateStyle() {
DCHECK(!view()->shouldThrottleRendering());
TRACE_EVENT_BEGIN0("blink,blink_style", "Document::updateStyle");
- SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Style.UpdateTime");
+ double startTime = monotonicallyIncreasingTime();
unsigned initialElementCount = styleEngine().styleForElementCount();
@@ -2081,6 +2082,12 @@ void Document::updateStyle() {
"blink,blink_style", "Document::updateStyle", "resolverAccessCount",
styleEngine().styleForElementCount() - initialElementCount);
}
+
+ double updateDurationSeconds = monotonicallyIncreasingTime() - startTime;
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, updateHistogram,
+ ("Style.UpdateTime", 0, 10000000, 50));
+ updateHistogram.count(updateDurationSeconds * 1000 * 1000);
+ CSSTiming::from(*this).recordUpdateDuration(updateDurationSeconds);
}
void Document::notifyLayoutTreeOfSubtreeChanges() {
« no previous file with comments | « third_party/WebKit/Source/core/css/StyleSheetContents.cpp ('k') | third_party/WebKit/Source/core/timing/PerformanceTiming.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698