I am looking for a tool similer to powertop for macOS. I'd like to see which processes have the largest power use (activity monitor shows apps but not servers like nginx and node and I'd like to see the power use of those server processes too). Any suggestions?
In addition to the Energy tab in Activity Monitor, there is the command-line
powermetrics that gives you more detailed information, such as CPU wattage and C-States. Try the
--show-process-energy option for the same Energy Impact metric as Activity Monitor.
Not exactly like powertops, but you can use powermetrics:
sudo powermetrics --show-process-energy
More details from the manual:
powermetrics gathers and display CPU usage statistics (divided into time spent in user mode and supervisor mode), timer and interrupt wakeup frequency (total and, for near-idle workloads, those that resulted in pack- age idle exits), and on supported platforms, interrupt frequencies (categorized by CPU number), package C- state statistics (an indication of the time the core complex + integrated graphics, if any, were in low-power idle states), as well as the average execution frequency for each CPU when not idle.
Also, you might want to use the top command:
top -stats pid,command,power -o power -l 0