Browse Source

Output end-to-end bootstrap time (#19034)

Change-Id: Ie3d75b3ca0c6535f03d08672677ffb95a86bde2f
tags/7.6.0.alpha7
Leif Åstrand 8 years ago
parent
commit
939b0cd26e
1 changed files with 19 additions and 0 deletions
  1. 19
    0
      client/src/com/vaadin/client/communication/MessageHandler.java

+ 19
- 0
client/src/com/vaadin/client/communication/MessageHandler.java View File

@@ -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;
}
}-*/;

}

Loading…
Cancel
Save