Bug 681535 - XUL reflow telemetry; r=dbaron

This commit is contained in:
Nathan Froyd 2011-10-17 12:49:57 -04:00
Родитель 2cf7bc83c1
Коммит 2091e7ce9a
2 изменённых файлов: 15 добавлений и 1 удалений

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

@ -199,6 +199,7 @@
#include "mozilla/FunctionTimer.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "Layers.h"
@ -1906,6 +1907,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
}
NS_TIME_FUNCTION_WITH_DOCURL;
mozilla::TimeStamp timerStart = mozilla::TimeStamp::Now();
NS_ASSERTION(!mDidInitialReflow, "Why are we being called?");
@ -2046,6 +2048,11 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
}
}
if (root && root->IsXUL()) {
mozilla::Telemetry::AccumulateTimeDelta(Telemetry::XUL_INITIAL_FRAME_CONSTRUCTION,
timerStart);
}
return NS_OK; //XXX this needs to be real. MMP
}
@ -7331,7 +7338,7 @@ bool
PresShell::ProcessReflowCommands(bool aInterruptible)
{
NS_TIME_FUNCTION_WITH_DOCURL;
mozilla::TimeStamp timerStart = mozilla::TimeStamp::Now();
bool interrupted = false;
if (0 != mDirtyRoots.Length()) {
@ -7410,6 +7417,11 @@ PresShell::ProcessReflowCommands(bool aInterruptible)
UnsuppressAndInvalidate();
}
if (mDocument->GetRootElement() && mDocument->GetRootElement()->IsXUL()) {
mozilla::Telemetry::AccumulateTimeDelta(Telemetry::XUL_REFLOW_MS,
timerStart);
}
return !interrupted;
}

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

@ -235,3 +235,5 @@ HISTOGRAM(THUNDERBIRD_INDEXING_RATE_MSG_PER_S, 1, 100, 20, LINEAR, "Gloda: index
#endif
HISTOGRAM(INNERWINDOWS_WITH_MUTATION_LISTENERS, 0, 1, 2, BOOLEAN, "Deleted or to-be-reused innerwindow which has had mutation event listeners.")
HISTOGRAM(XUL_REFLOW_MS, 1, 3000, 10, EXPONENTIAL, "xul reflows")
HISTOGRAM(XUL_INITIAL_FRAME_CONSTRUCTION, 1, 3000, 10, EXPONENTIAL, "initial xul frame construction")