'How to measure how long it took to schedule a job with Android JobScheduler

Currently I'm trying to measure how long it takes for Android jobscheduler to schedule jobs for each process throughout the system.

Background: I'm part of the performance team who is trying to improve the situation during boot where processes are scheduling their jobs on BOOT_COMPLETE broadcast. Most processes are starting up to schedule their jobs on BOOT and going back to sleep until they actually have to run their job. My goal is to measure the time it took them to start up and schedule their job.

Measure this time: { com.example.test starts up -> schedules job for com.example.test -> goes back dormant}

Now I understand there is adb shell dumpsys jobscheduler which provides a lot of good information, however I'm not sure how to decipher what I want from this. Would anyone be able to help with any ideas?

PS. I'm not trying to do this for a single process, but rather all the processes that are scheduling on BOOT_COMPLETE



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source