this post was submitted on 14 Feb 2025
32 points (97.1% liked)

Linux

50396 readers
890 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

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.

top 21 comments
sorted by: hot top controversial new old
[–] eldavi@lemmy.ml 9 points 1 week ago (1 children)

i must be missing something about your question because this has been a thing for a while in the linux world.

the most recent version i can recall is using prometheus' node-exporter and a graphite based web user interface that can show power usage graph similar to the android battery usage ap.

[–] BrianTheeBiscuiteer@lemmy.world 4 points 1 week ago (1 children)

I'm guessing this isn't a totally comprehensive article but I'm not sure it will give the granularity I need: https://betterstack.com/community/guides/monitoring/monitor-linux-prometheus-node-exporter/

I would hope to get process names as part of the export.

[–] eldavi@lemmy.ml 2 points 1 week ago

nice find; it's not exactly the way i've done it in the past; but the part of prometheus seems solid. and in case you didn't know, you don't have to use prometheus, any sort of monitoring system will work. zabbix is more all-in-one including a dashboard and also capable of doing this and you can use a nagios/icinga w grafana combo if prometheus is too odd for you.

in your shoes and i wanted a per process based graph; i would modify node-exporter to pick up additional data from something like a text file and along with custom persistent shell script can write the process names & data to that file.

then i would configure graphite/grafana, to render each graph based on each process. (i only have experience doing this on grafana; so i don't know if better stack it's capable of doing this, but i would be surprised if it can't).

powertop shows point in time data, but you can just export it to something and work from there.

[–] Eideen@lemmy.world 4 points 1 week ago (1 children)

A tool like Librenms will give you this.

[–] BrianTheeBiscuiteer@lemmy.world 1 points 1 week ago (1 children)

It might but it also looks really advanced. I'm hoping to get stats on just one machine and not really monitor my entire infrastructure (which ain't much).

[–] Eideen@lemmy.world 2 points 1 week ago

Then a tool like netdata may be the thing.

[–] vk6flab@lemmy.radio 3 points 1 week ago (2 children)

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.

[–] async_amuro@lemm.ee 5 points 1 week ago

I enjoy btop personally

[–] BrianTheeBiscuiteer@lemmy.world 1 points 1 week ago (1 children)

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.

[–] vk6flab@lemmy.radio 1 points 1 week ago (1 children)

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.

[–] ZeroHora@lemmy.ml 3 points 1 week ago* (last edited 1 week ago) (1 children)

The new KDE 6.3.0 info center have this as a feature or I understand it wrong? Couldn't test it yet.

I'm on Budgie. 😕

[–] Gayhitler@lemmy.ml 2 points 1 week ago

Learn cacti

[–] TxTechnician@lemmy.ml 2 points 1 week ago

I know that the system monitor app that's included in KDE has a pretty extensive custom page tracking option.

You can open it up and then put in a whole bunch of like settings in a new page and track pretty much every metric that your computer has.

[–] Emberleaf@lemmy.ml 2 points 1 week ago (1 children)

Looks nice but their graph doesn't seem to show more than usage per core, not per process. Just based on the screenshots that is.

[–] penquin@lemm.ee 1 points 1 week ago (1 children)

Any system monitor app (and basically every DE has one) will show you the cpu usage. Check out Mission Center . It's almost a carbon copy of windows' task manager.

I have Mission Center. It's great but at the process level it only shows current usage, not a time series average or summation.

[–] lordnikon@lemmy.world 1 points 1 week ago

Glimpse is CLI and web but it's a great