summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2015-09-29 15:37:31 +0300
committerVaadin Code Review <review@vaadin.com>2015-09-29 14:19:39 +0000
commit939b0cd26e599130936c8f2b8c7d5e257b63e105 (patch)
tree35bb8b2db933cb78c885818f41a559a68f0d9ed9 /client
parentf594b3aba5b89d7fe8231059125ffff57ca295b3 (diff)
downloadvaadin-framework-939b0cd26e599130936c8f2b8c7d5e257b63e105.tar.gz
vaadin-framework-939b0cd26e599130936c8f2b8c7d5e257b63e105.zip
Output end-to-end bootstrap time (#19034)
Change-Id: Ie3d75b3ca0c6535f03d08672677ffb95a86bde2f
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/communication/MessageHandler.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/communication/MessageHandler.java b/client/src/com/vaadin/client/communication/MessageHandler.java
index e86c94c8c6..e87928fc57 100644
--- a/client/src/com/vaadin/client/communication/MessageHandler.java
+++ b/client/src/com/vaadin/client/communication/MessageHandler.java
@@ -546,6 +546,16 @@ public class MessageHandler {
.getTime());
totalProcessingTime += lastProcessingTime;
if (bootstrapTime == 0) {
+
+ double fetchStart = getFetchStartTime();
+ if (fetchStart != 0) {
+ int time = (int) (Duration.currentTimeMillis() - fetchStart);
+ getLogger().log(
+ Level.INFO,
+ "First response processed " + time
+ + " ms after fetchStart");
+ }
+
bootstrapTime = calculateBootstrapTime();
if (Profiler.isEnabled() && bootstrapTime != -1) {
Profiler.logBootstrapTimings();
@@ -1747,4 +1757,13 @@ public class MessageHandler {
return parseJson(stripJSONWrapping(wrappedJsonText));
}
+ private static final native double getFetchStartTime()
+ /*-{
+ if ($wnd.performance && $wnd.performance.timing && $wnd.performance.timing.fetchStart) {
+ return $wnd.performance.timing.fetchStart;
+ } else {
+ return 0;
+ }
+ }-*/;
+
}