Procházet zdrojové kódy

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

Change-Id: Ie3d75b3ca0c6535f03d08672677ffb95a86bde2f
tags/7.6.0.alpha7
Leif Åstrand před 8 roky
rodič
revize
939b0cd26e

+ 19
- 0
client/src/com/vaadin/client/communication/MessageHandler.java Zobrazit soubor

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

}

Načítá se…
Zrušit
Uložit