Firefox OS/Performance/Boot Timing Automation
As per Bug 1045938, the plan for implementing automated boot info capturing will be described below. The end goal is the eventual creation of a system to support the continued tracking of the status of boot performance. That is to say, one should be able to simply do something like
make test-perf boottest
and receive the appropriate data. Furthermore we would like to get this information into datazilla along with all the other performance numbers we track.
Plan Outline
The simplest approach we could take for accomplishing this is as follows:
The data emitted for each stage will be:
- Capture and store pre-gecko timing to disk (something like
"/data/local/.BOOTTIMES"
)- JSON format to be compatible with the tools.
- Settings.js/shell.js emits some "created" event near its beginning; Questions:
- Can make test-perf handle events coming from the chrome side?
- Is make test-perf awake early enough to catch the events?
- If not, we could send timing information in the event itself.
- System app (in gaia) emits some "created" event
- Do this right before iframe creation in shell.js ?
- System App:
- Emit moz-* events
- Will need to implement above events for system app.
- Emit moz-* events
- Vertical home screen
- moz-* are emitted
- No way of actually observing these events for homescreen currently implemented.
make test-perf
will consume the file, and all these events to give back meaningful data.
In the pre-gecko timing one of the data points will be a pair of both "uptime" and "epoch time". Using this, we can calculate the time of boot in terms of epoch time, which is more compatible with times we have access to in the higher levels of the stack. Then, for each "created" event the current time will be recorded, etc. There may need to be additional handling for getting compatible times from the moz-*
events.
If make test-perf is not active early enough to catch events from shell.js, we could have it such that the system sends an event into shell when the test runner is actually ready, and tells it to emit the event (with some stored timestamp). This depends on make test-perf being able to observe the system app in the first place.