diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-03-06 13:30:38 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2013-03-06 13:31:14 +0200 |
commit | effe571067d7d238397b464aa367f6425a2ab2bf (patch) | |
tree | 0cb25b6c6753d3ee6ba76623a3cbcf329acfc373 /server/src/com/vaadin | |
parent | 7abb5e3397cc2bf40a2dbaba94573c7653b4b12e (diff) | |
download | vaadin-framework-effe571067d7d238397b464aa367f6425a2ab2bf.tar.gz vaadin-framework-effe571067d7d238397b464aa367f6425a2ab2bf.zip |
Profiler based on __gwtStatsEvent (#10960)
* Bootstrap installs a __gwtStatsEvent implementation for tracking GWT's
own bootstrap timing events
* Profiler.enter and Profiler.leave use __gwtStatsEvent
* Profiler data is displayed based on the data tracked by
__gwtStatsEvent
Change-Id: I3db05ca2622aecb745270f01d47cd71648e3bebd
Diffstat (limited to 'server/src/com/vaadin')
-rw-r--r-- | server/src/com/vaadin/server/BootstrapHandler.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java index 456aeaa478..403fefc0e1 100644 --- a/server/src/com/vaadin/server/BootstrapHandler.java +++ b/server/src/com/vaadin/server/BootstrapHandler.java @@ -374,6 +374,18 @@ public abstract class BootstrapHandler implements RequestHandler { boolean isDebug = !context.getSession().getConfiguration() .isProductionMode(); + if (isDebug) { + /* + * Add tracking needed for getting bootstrap metrics to the client + * side Profiler if another implementation hasn't already been + * added. + */ + builder.append("if (typeof window.__gwtStatsEvent != 'function') {\n"); + builder.append("vaadin.gwtStatsEvents = [];\n"); + builder.append("window.__gwtStatsEvent = function(event) {vaadin.gwtStatsEvents.push(event); return true;};\n"); + builder.append("}\n"); + } + builder.append("vaadin.initApplication(\""); builder.append(context.getAppId()); builder.append("\","); |