2

I know there's top and htop commands, but they lack a lot of information. For example there is no way to list processes from Energy tab. Or is there at least some kind of API for Activity Monitor which could be used to develop the desired command line tool?

1 Answer 1

2

A good reference giving insight on the energy tab is given here. It relates it to the Power column of the top command which you can generate by using top command as such: top -stats pid,command,cpu,idlew,power -o power -d The power column is not usually displayed due to width of monitor.

9
  • I've read that before. As I said I know there is top - and it's absolutely not enough. This gives you current power usage but doesn't say if it's because of high perf gpu request or not. I would doubt also in accuracy as thread requiring high perf gpu is often not at the top yet battery drains much faster. But maybe it's because you get a snapshot of current energy usage every second - if somehow this could be accumulated per second or better per minute - then maybe it would push problematic pid at the top of the list. Activity Monitor has a variable saying if thread requires high gpu or not. Commented Apr 24, 2019 at 16:48
  • Or in short, activity monitor has plenty more data than top or htop. Commented Apr 24, 2019 at 16:48
  • No, activity monitor has same data as top or htop but it creates combinations of some of the info into new catagories. Not new data but just a combination ofinfo.
    – Natsfan
    Commented Apr 24, 2019 at 17:03
  • Well, then how to get "high perf gpu" column in top? Or "App Nap" or "Preventing sleep"? Commented Apr 24, 2019 at 17:22
  • 1
    It's not. I understand and agree with what you are saying. Top doesn't provide what you want and hence the info must be availabe elsewhere. Activity Monitor is the easiest answer but hard to extract using command line. The point I was trying to make is that another unix command, besides top, may have the data you are looking for. But its hard to tell since a definition for the parameter is not given. The actual data may not be generated anywhere but is calculated in activity monitor. I wasn't trying to say my answer was correct and I'm sorry if my comments came off like that.
    – Natsfan
    Commented Apr 24, 2019 at 23:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .