WebPagetest Forums
Where does WPT determine LoadTime and SpeedIndex? - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Private Instances (/forumdisplay.php?fid=12)
+--- Thread: Where does WPT determine LoadTime and SpeedIndex? (/showthread.php?tid=13355)

Where does WPT determine LoadTime and SpeedIndex? - sidbala - 11-07-2014 04:45 AM

I've been playing around with WPT private agents for some time now. It is an amazing tool.

Now, I am looking at WPT to implement a simple test for Mobile devices (Android & iOS). I am interested in SpeedIndex by Video, SpeedIndex by Paint events and LoadTime. I am not particularly interested in the waterfall, content and optimization functionality.

Ideally I would like to have this as a standalone test (no WPT server/agent separation) - so it can be used in our continuous integration tooling.

I am looking into the nodejs mobile agent and the server php code. It is not entirely clear to me how and where the three metrics I am looking for are generated. I already have a simple page cycler implemented that is capable of grabbing devtools messages from the various devices. The cycler can also initiate video capture on these devices.

Where in the code do I look for calculation of LoadTime, SpeedIndex and SpeedIndex via paint events? Which devtools messages I need to grab for these to work?

I can't seem to find these calculations in the nodejs agent, so I assume this is part of the server code. Can the server side PHP scripts be feasibly run isolated on a local machine?

Thanks a ton!

RE: Where does WPT determine LoadTime and SpeedIndex? - pmeenan - 11-12-2014 07:23 AM

Right now all of the logic is on the server. The video parsing is done in video/avi2frames.php, speed index is calculated in video/visualProgress.php.inc (or something like that) and load time is in devtools.php.inc

To get it all working you need the Network, Page and Timeline dev tools events (timeline is used to sync the video start time).

At some point I'm planning on implementing most of it in python as a stand-alone script that can be run against a timeline + video but that's probably a few months out.