green-coding-solutions / green-metrics-tool

Measure energy and carbon consumption of software
https://metrics.green-coding.io
GNU Affero General Public License v3.0
166 stars 22 forks source link

Added DiskIO Reporter #825

Closed ArneTR closed 1 week ago

ArneTR commented 3 months ago

This PR adds a Disk I/O reporter.

To make it container agnostic the data is pulled directly from the sysfs. This needs the IO delegator to be set as specified in the documentation.

I am currently under the assumption that this controller is always active for docker in root mode, but will double check soon.

The approach here is similar to the other cgroup reading metric providers. However while crafting this the idea came up to actually split Input and Output and not supply the value as a cumulated number.

I see here two options:

Here I think @ribalba it makes sense to discuss how this was solved in the lm_sensors

github-actions[bot] commented 3 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run (incl. overhead)|23.3636|1671.39|3.87|432| |Measurement #1|23.2916|1671.39|3.88|431| 🌳 CO2 Data: City: Phoenix, Lat: 33.4475, Lon: -112.0866 IP: 20.169.14.176 CO₂ from energy is: 0.476346150 g CO₂ from manufacturing (embodied carbon) is: 0.123255565 g Carbon Intensity for this location: 285 gCO₂eq/kWh SCI: 0.599602 gCO₂eq / pipeline run emitted
github-actions[bot] commented 1 month ago
Eco-CI Output: Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 25.0178 1570.25 3.93 400
Measurement #1 24.9735 1570.25 3.95 398

🌳 CO2 Data: City: Boydton, Lat: 36.6534, Lon: -78.375 IP: 20.161.78.144 CO₂ from energy is: 0.617108250 g CO₂ from manufacturing (embodied carbon) is: 0.114125523 g Carbon Intensity for this location: 393 gCO₂eq/kWh SCI: 0.731234 gCO₂eq / pipeline run emitted

ArneTR commented 1 month ago

@ribalba All done. Quick Re-review please as I changed this also in all other C source files we have