Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit eb4aa15

Browse files
authored
Set timing for default page (#155)
1 parent d651399 commit eb4aa15

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

browserup-proxy-core/src/main/java/com/browserup/bup/BrowserUpProxyServer.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
import com.browserup.bup.proxy.dns.DelegatingHostResolver;
6666
import com.browserup.bup.util.BrowserUpHttpUtil;
6767
import com.browserup.bup.util.BrowserUpProxyUtil;
68-
import org.littleshoot.proxy.SslEngineSource;
6968
import org.littleshoot.proxy.extras.SelfSignedSslEngineSource;
7069
import org.apache.commons.lang3.StringUtils;
7170
import org.littleshoot.proxy.ChainedProxy;
@@ -678,6 +677,14 @@ public void setWriteBandwidthLimit(long bytesPerSecond) {
678677
}
679678
}
680679

680+
private void updateDefaultPageTimings() {
681+
getDefaultPage().ifPresent(page -> {
682+
if (page.getStartedDateTime() != null) {
683+
page.getPageTimings().setOnLoad(Math.toIntExact(new Date().getTime() - page.getStartedDateTime().getTime()));
684+
}
685+
});
686+
}
687+
681688
@Override
682689
public long getWriteBandwidthLimit() {
683690
return writeBandwidthLimitBps;
@@ -698,6 +705,8 @@ public void endPage() {
698705
.getPageTimings()
699706
.setOnLoad(Math.toIntExact(new Date().getTime() - previousPage.getStartedDateTime().getTime()));
700707
}
708+
709+
updateDefaultPageTimings();
701710
}
702711

703712
@Override

0 commit comments

Comments
 (0)