Unless I’m using the wrong terms in my search it really seems like there’s no tool for Linux that can tell me what processes used the most CPU (typically this has a high correlation with energy usage) in the last hour or 24 hours.
Basically I want something like the Android battery usage app but for Linux.
The
top
command will tell you what each process is using in terms of CPU and memory. You can log this to a database and analyse it as required.I’d be surprised if the Android battery application was anything different.
I enjoy btop personally
Any tips or how-to article that says how to push the
top
data to a DB? I figure scraping the output is no good because the layout is dynamic.When you pipe the output, it’s a single shot, no dynamic updates.
Right, I just meant I figured the data might shift horizontally between snapshots but I guess Awk can figure it out.