Where does WPT determine LoadTime and SpeedIndex?

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!

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.