From c40f7f7491edb21c59099b5e3e1c64b90372bf0a Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 10 Jan 2012 15:08:43 -0500 Subject: [PATCH] Bug 709971 - HTML reflow telemetry; r=bz --- layout/base/nsPresShell.cpp | 7 ++++--- toolkit/components/telemetry/TelemetryHistograms.h | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 1ba8870cb23..abb1299da55 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -7506,9 +7506,10 @@ PresShell::ProcessReflowCommands(bool aInterruptible) UnsuppressAndInvalidate(); } - if (mDocument->GetRootElement() && mDocument->GetRootElement()->IsXUL()) { - mozilla::Telemetry::AccumulateTimeDelta(Telemetry::XUL_REFLOW_MS, - timerStart); + if (mDocument->GetRootElement()) { + Telemetry::ID id = (mDocument->GetRootElement()->IsXUL() + ? Telemetry::XUL_REFLOW_MS : Telemetry::HTML_REFLOW_MS); + Telemetry::AccumulateTimeDelta(id, timerStart); } return !interrupted; diff --git a/toolkit/components/telemetry/TelemetryHistograms.h b/toolkit/components/telemetry/TelemetryHistograms.h index 42516249e16..1205203ddc0 100644 --- a/toolkit/components/telemetry/TelemetryHistograms.h +++ b/toolkit/components/telemetry/TelemetryHistograms.h @@ -314,7 +314,8 @@ HISTOGRAM_BOOLEAN(FX_CONTEXT_SEARCH_AND_TAB_SELECT, "Firefox: Background tab was // #endif HISTOGRAM_BOOLEAN(INNERWINDOWS_WITH_MUTATION_LISTENERS, "Deleted or to-be-reused innerwindow which has had mutation event listeners.") -HISTOGRAM(XUL_REFLOW_MS, 1, 3000, 10, EXPONENTIAL, "xul reflows") +HISTOGRAM(XUL_REFLOW_MS, 1, 3000, 10, EXPONENTIAL, "XUL reflows (ms)") +HISTOGRAM(HTML_REFLOW_MS, 1, 3000, 10, EXPONENTIAL, "HTML reflows (ms)") HISTOGRAM(XUL_INITIAL_FRAME_CONSTRUCTION, 1, 3000, 10, EXPONENTIAL, "initial xul frame construction") HISTOGRAM_BOOLEAN(XMLHTTPREQUEST_ASYNC_OR_SYNC, "Type of XMLHttpRequest, async or sync")