Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] Display Power Usage Stats #594

Open
Sol33t303 opened this issue Aug 4, 2023 · 2 comments
Open

[REQUEST] Display Power Usage Stats #594

Sol33t303 opened this issue Aug 4, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Sol33t303
Copy link

Describe the solution you'd like
I'd love for btop to also be able to show a power usage graph, possibly one that can show volts, amps and watts used reported from the battery in one graph. I think this would work increadibly well in conjunction with the rest of the stats being provided, being able to view power usage as CPU, disk and network utilisation goes up and down would be very helpful. If UI realestate is at a premium even just a small "W: " besides the battery indicator would be helpful. I also wander if it would be possible to list energy use by each process like in Android? Although I think that might be a bit far fetched (I know powertop estimates this, maybe it might be possible to look there for inspiration?).

Describe alternatives you've considered
None, I am not aware of any other tools that graph power usage on linux off the top of my head, and certainly none that provide other system stats at the same time.

Additional context
I think it would be best to leave the feature turned off by default, as it will primarily only be used by laptop users (although I do like that btop actually detects the battery in my bluetooth controller on my desktop), I think battery information is an important thing to include in any general system monitors as it is an integral part of the system.

@Sol33t303 Sol33t303 added the enhancement New feature or request label Aug 4, 2023
@YuriiShkrobut
Copy link

YuriiShkrobut commented Aug 9, 2023

Created PR with this feature, only Intel supported for now (have no AMD CPU to test).
(only watts, without graph)
#595

@vsey
Copy link
Contributor

vsey commented Dec 12, 2023

Hi @YuriiShkrobut,

I've looked at your changes in PR #595 where you use /sys/class/powercap/intel-rapl:0/energy_uj to calculate CPU power. I'd like to suggest an improvement that might broaden its applicability.

My suggestion is to add a power consumption indicator for the system battery to the battery indicator on laptops.
This would have the advantage of being an indicator of the energy consumption of the whole system, another advantage is that it also works for AMD systems, the disadvantage would be that it only works for laptops.
Therefore, my suggestion is to add a power consumption to the battery section for laptops with the following metrics

  • Battery current: /sys/class/power_supply/BAT0/current_now.
  • Battery voltage: /sys/class/power_supply/BAT0/voltage_now.
  • Battery current: battery current * battery voltage.

A small caveat to this method is that it is only effective when the laptop is running on battery power. When the laptop is plugged in, these readings reflect the power going to the battery, not the actual power being used by the system.

I think adding this metrics to the battery indicator could be useful for laptops users. I look forward to hearing your thoughts on this!

Best,
vsey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants