Skip to content

green-kernel/frontend-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ProcPower Sustainability Monitor — Desktop (Linux)

A lightweight Qt desktop app that visualizes per-PID energy from the procpower kernel extension in real time (1-second default). It reads /proc/energy/cgroup, plots a live line chart, shows the latest readings in a sortable table, and includes the raw file for debugging.

Screenshot of the desktop app

✨ Features

  • Live chart of energy (kWh) by PID (updates every second by default)
  • Sortable table of the latest readings (PID, comm, energy)
  • Raw /proc/energy/cgroup view for debugging
  • Adjustable polling interval and max points from the UI
  • Gaps are handled gracefully when PIDs appear/disappear

⚙️ Requirements

  • Linux with procpower installed and /proc/energy/cgroup available

📦 Installation

Create a virtual environment and install dependencies:

python3 -m venv venv
source venv/bin/activate
pip install PySide6 pyqtgraph numpy

▶️ Run

python energy_show.py

Command-line options:

--file PATH        Path to /proc/energy/cgroup (default: /proc/energy/cgroup)
--interval MS      Polling interval in milliseconds (default: 1000; min: 200)
--max-points N     How many points to keep in the rolling chart window (default: 300)

Examples:

# Faster updates
python energy_show.py --interval 500

# Keep a longer history
python energy_show.py --max-points 1200

# Read from a different file
python energy_show.py --file /tmp/cgroup_snapshot

🖥️ UI at a Glance

  • Status (top left): current state and timestamp of last read
  • Chart (left): per-PID energy over time; legend autoupdates if a PID’s comm changes
  • Table (right): latest readings sorted by energy (desc)
  • Raw file (right): the exact content read from /proc/energy/cgroup

Use the footer controls to tweak Polling interval and Max points while running.

🛠️ Troubleshooting

The chart doesn’t move / table stays empty

  • The app could not parse any entries. Open the Raw file panel and confirm it contains lines like:
    pid=123 energy=456789 ... comm=python
    
    pid, comm, and energy are required.

About

A litte app that shows you the energy usage of all processes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages