I'd like to benchmark battery usage between distros and DEs

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:

  1. opens a couple of applications
  2. remains idle for some time – like 4 minutes
  3. copies a 3 to 4 meg file
  4. closes the apps that were opened in #1
  5. opens new apps
  6. remains idle again
  7. renders a file from one format to another (this could be done with ffmpeg)
  8. sleeps again
  9. closes the apps from #5
  10. 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.