Can anyone think of a good scientific method for measuring battery life? Like an automated reproducible workload that tries to mimics an “average” user. A Phoronix Test Suite but for battery life.
For the “average” user applications are open on the desktop and the user stares at the screen. Occasionally, they will type on the keyboard which perhaps instantiates an auto save. Occasionally, they will render files or convert files from one format to another. Then they are likely to close those apps and opens others – only to repeat their main work of staring. Given this possible “average” scenario, I would generate a script that:
- opens a couple of applications
- remains idle for some time – like 4 minutes
- copies a 3 to 4 meg file
- closes the apps that were opened in #1
- opens new apps
- remains idle again
- renders a file from one format to another (this could be done with ffmpeg)
- sleeps again
- closes the apps from #5
- repeat the cycle until it dies
Put these in a script to be executed automatically by a cron entry on a frequency of say – every 20 minutes. Additionally, I would put the following command in a cron entry with a frequency of every minute allowing you to walk away from the laptop and later determine when it died.
echo "$(date +"%F_%R")" >> ~/Desktop/battery.log
Just remember that with a scientific experiment you have to isolate your variables and be sure that you only have one independent variable – in this case that needs to be the Distro – so everything else needs to be exactly the same – cpu, memory, room temperature, apps opened, files copy or moved, percentage of battery charge at start, etc. This will give you the dependent variable you seek: the time life of a fully charged battery running Distro A as compared to the time life of a fully charged battery running Distro B.