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

Unified Diff: third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp

Issue 2283803002: Add histogram to track overhead for scanning external css (Closed)
Patch Set: properly set upstream Created 4 years, 4 months 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp
index 65a946e34961c0d11d06b38d4e55854c607cdfbf..4c95d82e3354ee0f7daa1da53014ef26669072c1 100644
--- a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp
+++ b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp
@@ -273,12 +273,15 @@ void CSSPreloaderResourceClient::scanCSS(const CSSStyleSheetResource* resource)
// TODO(csharrison): If this becomes an issue the CSSPreloadScanner may be
// augmented to take care of this case without performing an additional
// copy.
+ double startTime = monotonicallyIncreasingTimeMS();
const String& chunk = resource->decodedText();
if (chunk.isNull())
return;
CSSPreloadScanner cssPreloadScanner;
PreloadRequestStream preloads;
cssPreloadScanner.scan(chunk, SegmentedString(), preloads, resource->response().url());
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, cssScanTimeHistogram, ("PreloadScanner.ExternalCSS.ScanTime", 1, 1000000, 50));
+ cssScanTimeHistogram.count((monotonicallyIncreasingTimeMS() - startTime) * 1000);
fetchPreloads(preloads);
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698