A WordPress admin plugin that visualizes the energy consumption of your WordPress installation in real time.
It reads data from the procpower kernel extension (/proc/energy/cgroup) and displays it in a live chart (1-second interval) directly in the WordPress dashboard.
- Adds a Sustainability menu entry in the WordPress admin area
- Reads energy usage per PID from
/proc/energy/cgroup(viaprocpower) - Displays a real-time line chart using Chart.js
- Shows tabular readings sorted by current energy use
- Includes raw
/proc/energy/cgroupoutput for debugging - Keeps data fully inside the Docker container β no sensitive host data is leaked
- Linux host with
procpowerinstalled and/proc/energy/cgroupavailable - Docker & Docker Compose
- WordPress (containerized in this setup)
Due to the way Linux and Docker work, we can only show the energy usage of the container the plugin is running in. It is technically not possible to display the resource consumption of other processes.
If you are running your database somewhere else, you will need to install a logger inside this container. This is straightforward, as you can simply read the cgroup file available within the container.
Clone this repository and run WordPress with the plugin:
git clone https://github.com/your-org/wp-sustainability-monitor.git
cd wp-sustainability-monitor
docker compose up
Then you can access the demo under http://localhost:8080/