Skip to content

Latest commit

 

History

History
86 lines (56 loc) · 2.75 KB

scaphandre-sheet.md

File metadata and controls

86 lines (56 loc) · 2.75 KB

Scaphandre workshop sheet

Scaphandre in an open source software capable to estimate the energy consumed by your machine and attribute this consumption to the running processes.

Getting started

To quickly run scaphandre in your terminal you may use docker:

docker run --privileged -v /sys/class/powercap:/sys/class/powercap -v /proc:/proc -ti hubblo/scaphandre stdout -t 15

It should write in Stdout the top 5 process consumer on your machine for 15 secondes.

expected kind of output:

Scaphandre stdout exporter
Sending ⚡ metrics
Measurement step is: 2s
Host:	0 W
	package 	core		dram
Top 5 consumers:
Power		PID	Exe
No processes found yet or filter returns no value.
------------------------------------------------------------

Host:	2.563512 W
	package 	core		dram
Socket0	2.563512 W |	0.807113 W	0.527853 W	

Top 5 consumers:
Power		PID	Exe
0.445828 W	641	"nv_queue"
0.111457 W	398	"systemd-journal"
0.111457 W	639	"irq/131-nvidia"
0.111457 W	649	"dbus-daemon"
0 W	1	"systemd"
------------------------------------------------------------

The exporter used stdout is quite basic. other exporters exists, have a look at the documentation (json, prometheus, etc...)

Try the prometheus exporter

docker run --privileged -v /sys/class/powercap:/sys/class/powercap -v /proc:/proc -p 8080:8080 -ti hubblo/scaphandre prometheus

when the container is deployed, check the metrics endpoint:

curl -s http://localhost:8080/metrics

Run a complete stack with docker-compose

You can have a look at the documentation page about how to Run a complete stack with docker-compose

Start by going to the scaphandre folder of this repository and run docker-compose:

cd scaphandre
docker-compose up

Grafana will be available at http://localhost:3000, the default username is admin and the password is secret.

Going further

  • Create a dashboard to look at the consumption of your browser. The interesting metrics is named scaph_process_power_consumption_microwatts

  • Create a dashboard to look at the sum of the power domain power consumption and the host host consumption. Is there a difference ?

hints: