We need to monitor the “boot” time between when the power is plugged into the device and when our application is ready for use. We only want to measure during normal use cycles not during updates as that will add noise to our measurements.
The normal use cycle for our devices is to be turned on by applying power, be active for 10-40 minutes, and then be turned off by pulling the power. In these cycles reading the value of uptime when our application is ready will give the desired result.
In “abnormal” use cycles, such as updating the application, reading the value of uptime will add noise to our measurements. We are looking for a solution to deterministically detect whether the container was started at boot or at some later point in time.
We could detect this by comparing the uptime (of the host) to when the first process was started (e.g. stat /proc/1/cmdline
). However, we would prefer a solution that does not depend on time as we cannot control how long the device is on during either normal or abnormal use.