From c11c663498f93c5e1d9f6086afaed698951d49e0 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Wed, 30 Mar 2016 09:28:44 -0400 Subject: [PATCH] Add finished() metric for login and registration. Call New Relic's finished() event marker to measure when the login and registration pages actually become usable. This is important because the pageLoad event can be distorted by analytics and marketing tools that trigger after the page looks complete to the user. Note: The "xfinished" PageAction is there to work around a New Relic bug where "finished" events weren't making it into Insights. The reason we have both is because finished() *does* still show up in session traces. [PERF-298] --- lms/templates/student_account/login_and_register.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lms/templates/student_account/login_and_register.html b/lms/templates/student_account/login_and_register.html index e83d1cbeec..dc01423f01 100644 --- a/lms/templates/student_account/login_and_register.html +++ b/lms/templates/student_account/login_and_register.html @@ -13,6 +13,14 @@ <%static:require_module module_name="js/student_account/logistration_factory" class_name="LogistrationFactory"> var options = ${data | n, dump_js_escaped_json}; LogistrationFactory(options); + if ('newrelic' in window) { + newrelic.finished(); + // Because of a New Relic bug, the finished() event doesn't show up + // in Insights, so we have to make a new PageAction that is basically + // the same thing. We still want newrelic.finished() for session + // traces though. + newrelic.addPageAction('xfinished'); + }