Skip to content
This repository has been archived by the owner on Mar 11, 2019. It is now read-only.

Example of usage CLI

Loïc Huertas edited this page Nov 3, 2015 · 5 revisions

What is the CPU energy spent by the 123 process? Please give me fresh results every 500 milliseconds

To do this (under Linux systems) with CLI, you have to type this following command at the root folder of the PowerAPI archive:

./bin/powerapi \
    modules procfs-cpu-simple \
    monitor \
      --frequency 500 \
      --pids 123 \
      --console

And this command for Windows and Mac OS X:

./bin/powerapi \
    modules sigar-cpu-simple \
    monitor \
      --frequency 500 \
      --pids 123 \
      --console

(The sigar-cpu-simple is required to run PowerAPI under Windows and Mac OS X systems.)

What is the CPU energy spent by Firefox? Please give me fresh results every second into chart

Under Linux systems:

./bin/powerapi \
    modules procfs-cpu-simple \
    monitor \
      --frequency 1000 \
      --apps firefox \
      --chart

Under Windows and Mac OS X:

./bin/powerapi \
    modules sigar-cpu-simple \
    monitor \
      --frequency 1000 \
      --apps firefox \
      --chart

What is the total CPU energy spent by the whole processes?

./bin/powerapi \
    modules procfs-cpu-simple \
    monitor \
      --frequency 1000 \
      --all \
      --console

What is the CPU energy spent by a Docker container named Hello_world?

Only under Linux systems:

./bin/powerapi \
    modules procfs-cpu-simple \
    monitor \
      --frequency 1000 \
      --container Hello_world \
      --console