This article describes the Activity Monitor, Battery Status Menu, and top
— three related tools available on Mac OS X.
Note: The power profiling overview is worth reading at this point if you haven’t already. It may make parts of this document easier to understand.
Activity MonitorThis is a built-in OS X tool that shows real-time process measurements. It is well-known and its “Energy Impact” measure is likely to be consulted by users to compare the power consumption of different programs. (Apple support documentation specifically recommends it for troubleshooting battery life problems.) Unfortunately “Energy Impact” is not a good measure for either users or software developers and it should be avoided. Activity Monitor can still be useful, however.
What does “Energy Impact” measure?“Energy Impact” is a hybrid proxy measure of power consumption. Careful investigation indicates that on Mac OS 10.10 and 10.11 it is computed with a formula that is machine model-specific, and includes the following factors: CPU usage, wakeup frequency, quality of service class usage, and disk, GPU, and network activity. The weightings of each factor can be found in one of the the files in /usr/share/pmenergy/Mac-<id>.plist
, where <id>
can be determined with the following command.
In contrast, on Mac OS 10.9 it is computed via a simpler machine model-independent formula that only factors in CPU usage and wakeup frequency.
In both cases “Energy Impact” often correlates poorly with actual power consumption and should be avoided in favour of direct measurements that have clear physical meanings.
What does “Average Energy Impact” measure?When the Energy tab of Activity Monitor is first opened, the “Average Energy Impact” column is empty and the title bar says “Activity Monitor (Processing…)”. After 5–10 seconds, the “Average Energy Impact” column is populated with values and the title bar changes to “Activity Monitor (Applications in last 8 hours)”. If you have top
open during those 5–10 seconds you’ll see that systemstats
is running and using a lot of CPU, and so presumably the measurements are obtained from it.
systemstats
is a program that runs continuously and periodically measures, among other things, CPU usage and idle wakeups for each running process. Tests indicate that it is almost certainly using the same “Energy Impact” formula to compute the “Average Energy Impact”, using measurements from the past 8 hours of wake time (i.e. if a laptop is closed for several hours and then reopened, those hours are not included in the calculation.)
top
top
is similar to Activity Monitor, but is a command-line utility. To see power-related measurements, invoke it as follows.
top -stats pid,command,cpu,idlew,power -o power -d
Note: -a
and -e
can be used instead of -d
to get different counting modes. See the man page for details.
It will show periodically-updating data like the following.
PID COMMAND %CPU IDLEW POWER 50300 firefox 12.9 278 26.6 76256 plugin-container 3.4 159 11.3 151 coreaudiod 0.9 68 4.3 76505 top 1.5 1 1.6 76354 Activity Monitor 1.0 0 1.0
The PID, COMMAND and %CPU columns are self-explanatory.
The IDLEW column is the number of “package idle exit” wakeups.
The POWER column’s value is computed by the same formula as the one used for “Energy Impact” by Activity Monitor in Mac OS 10.9, and should also be avoided.
top
is unlikely to be much use for power profiling.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3