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

Totals badge #108

Merged
merged 7 commits into from
Dec 19, 2024
Merged

Totals badge #108

merged 7 commits into from
Dec 19, 2024

Conversation

ArneTR
Copy link
Member

@ArneTR ArneTR commented Dec 19, 2024

Greptile Summary

This PR adds totals badge functionality and improves dashboard URL configuration in the Eco-CI Energy Estimation tool.

  • Added totals badge display in scripts/display_results.sh showing aggregate energy and carbon metrics
  • Added configurable dashboard-url parameter in action.yml defaulting to metrics.green-coding.io
  • Updated URL formatting in badge endpoints to remove double forward slashes
  • Added support for local GMT installations with internal testing URLs in local_ci.example.sh
  • Improved error handling and variable quoting in measurement scripts

Copy link

github-actions bot commented Dec 19, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 11.4183 35.9808 2.62 13.73
No quotes allowed in labels 18.16 7.77578 2.90 2.68
(Soo this is something) echo SHELL 13.03 11.1589 3.61 3.09
Environment setup (OS ubuntu-24.04, lint) 7.22333 8.20204 2.68 3.06
No quotes allowed in labels 7.63333 8.84413 2.88 3.07

🌳 CO2 Data:
City: Washington, Lat: 38.7095, Lon: -78.1539
IP: 172.190.111.17
CO₂ from energy is: 0.014679840 g
CO₂ from manufacturing (embodied carbon) is: 0.003917359 g
Carbon Intensity for this location: 408 gCO₂eq/kWh
SCI: 0.018597 gCO₂eq / pipeline run emitted

Copy link

github-actions bot commented Dec 19, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 5.1675 31.0078 2.12 14.63
No quotes allowed in labels 9.48 6.39855 2.11 3.03
(Soo this is something) echo SHELL 5.83 9.66966 3.11 3.11
Environment setup (OS ubuntu-22.04, lint) 2.07 7.38909 2.40 3.08
No quotes allowed in labels 2.23 7.55046 2.46 3.07

🌳 CO2 Data:
City: Chicago, Lat: 41.8874, Lon: -87.6318
IP: 172.183.132.69
CO₂ from energy is: 0.012650856 g
CO₂ from manufacturing (embodied carbon) is: 0.004174141 g
Carbon Intensity for this location: 408 gCO₂eq/kWh
SCI: 0.016825 gCO₂eq / pipeline run emitted

Copy link

github-actions bot commented Dec 19, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 5.64083 33.4705 2.28 14.67
No quotes allowed in labels 9.015 6.5698 2.23 2.95
(Soo this is something) echo SHELL 5.96 9.87103 3.17 3.11
Environment setup (OS ubuntu-20.04, lint) 2.77 8.09487 2.63 3.08
No quotes allowed in labels 4.20333 8.93482 2.90 3.08

🌳 CO2 Data:
City: Phoenix, Lat: 33.4475, Lon: -112.0866
IP: 20.172.28.146
CO₂ from energy is: 0.005756840 g
CO₂ from manufacturing (embodied carbon) is: 0.004185554 g
Carbon Intensity for this location: 172 gCO₂eq/kWh
SCI: 0.009942 gCO₂eq / pipeline run emitted

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile

local_ci.example.sh Show resolved Hide resolved
eco-ci-gitlab.yml Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
scripts/display_results.sh Outdated Show resolved Hide resolved
scripts/display_results.sh Outdated Show resolved Hide resolved
scripts/display_results.sh Show resolved Hide resolved
Copy link

github-actions bot commented Dec 19, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 7.85417 33.1036 2.31 14.30
No quotes allowed in labels 16.285 7.62722 2.55 2.99
(Soo this is something) echo SHELL 6.75 9.09973 2.94 3.10
Environment setup (OS ubuntu-20.04, lint) 4.34667 8.23331 2.67 3.08
No quotes allowed in labels 4.18333 8.14335 2.65 3.07

🌳 CO2 Data:
City: Washington, Lat: 38.7095, Lon: -78.1539
IP: 20.55.46.227
CO₂ from energy is: 0.013373612 g
CO₂ from manufacturing (embodied carbon) is: 0.004079987 g
Carbon Intensity for this location: 404 gCO₂eq/kWh
SCI: 0.017454 gCO₂eq / pipeline run emitted

Copy link

github-actions bot commented Dec 19, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 7.40083 35.8316 2.48 14.45
No quotes allowed in labels 10.425 7.28555 2.72 2.68
(Soo this is something) echo SHELL 8.94 10.7698 3.49 3.09
Environment setup (OS ubuntu-24.04, lint) 5.52333 9.1807 3.00 3.06
No quotes allowed in labels 4.89 8.59553 2.81 3.06

🌳 CO2 Data:
City: San Jose, Lat: 37.1835, Lon: -121.7714
IP: 52.234.38.86
CO₂ from energy is: 0.009387722 g
CO₂ from manufacturing (embodied carbon) is: 0.004122785 g
Carbon Intensity for this location: 262 gCO₂eq/kWh
SCI: 0.013511 gCO₂eq / pipeline run emitted

Copy link

github-actions bot commented Dec 19, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 4.76583 30.9747 2.07 14.97
No quotes allowed in labels 8.45 6.37343 2.19 2.91
(Soo this is something) echo SHELL 6.27 9.34599 3.00 3.12
Environment setup (OS ubuntu-22.04, lint) 3.08333 8.41645 2.72 3.09
No quotes allowed in labels 1.52667 6.83886 2.23 3.07

🌳 CO2 Data:
City: San Jose, Lat: 37.1835, Lon: -121.7714
IP: 52.238.27.194
CO₂ from energy is: 0.008115188 g
CO₂ from manufacturing (embodied carbon) is: 0.004271148 g
Carbon Intensity for this location: 262 gCO₂eq/kWh
SCI: 0.012386 gCO₂eq / pipeline run emitted

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile

scripts/make_measurement.sh Show resolved Hide resolved
scripts/display_results.sh Outdated Show resolved Hide resolved
Comment on lines 91 to 92
echo "<a href='https://www.electricitymaps.com/methodology#carbon-intensity-and-emission-factors' target=_blank rel=noopener>Carbon Intensity</a> for this location: <b>${ECO_CI_CO2I} gCO₂eq/kWh</b>" | tee -a $output $output_pr
printf "<a href='https://sci-guide.greensoftware.foundation/' target=_blank rel=noopener>SCI</a>: <b>%.6f gCO₂eq / pipeline run</b> emitted\n" ${ECO_CI_CO2EQ} | tee -a $output $output_pr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Missing quotes around ${ECO_CI_CO2EQ} in printf. Could fail if value contains spaces or special characters.

scripts/display_results.sh Show resolved Hide resolved
Copy link

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 8.09167 35.5903 2.56 13.88
No quotes allowed in labels 10.36 7.28485 2.69 2.71
(Soo this is something) echo SHELL 10.3967 10.9099 3.53 3.09
Environment setup (OS ubuntu-24.04, lint) 4.45667 8.61814 2.81 3.07
No quotes allowed in labels 4.58333 8.77738 2.86 3.07

🌳 CO2 Data:
City: Boydton, Lat: 36.6676, Lon: -78.3875
IP: 20.57.47.211
CO₂ from energy is: 0.014378360 g
CO₂ from manufacturing (embodied carbon) is: 0.003960156 g
Carbon Intensity for this location: 404 gCO₂eq/kWh
SCI: 0.018339 gCO₂eq / pipeline run emitted

Copy link

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 5.0225 28.461 1.97 14.47
No quotes allowed in labels 9.45 6.14705 2.04 3.01
(Soo this is something) echo SHELL 5.07667 8.27848 2.64 3.13
Environment setup (OS ubuntu-22.04, lint) 2.36 7.68267 2.49 3.09
No quotes allowed in labels 1.04667 6.3528 2.06 3.08

🌳 CO2 Data:
City: Boydton, Lat: 36.6676, Lon: -78.3875
IP: 20.75.95.108
CO₂ from energy is: 0.011498244 g
CO₂ from manufacturing (embodied carbon) is: 0.004128491 g
Carbon Intensity for this location: 404 gCO₂eq/kWh
SCI: 0.015627 gCO₂eq / pipeline run emitted

Copy link

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 5.55333 30.9941 2.16 14.32
No quotes allowed in labels 10.23 6.6705 2.25 2.96
(Soo this is something) echo SHELL 4.97333 8.52557 2.73 3.12
Environment setup (OS ubuntu-20.04, lint) 2.82 8.14509 2.64 3.08
No quotes allowed in labels 2.33333 7.65298 2.48 3.08

🌳 CO2 Data:
City: Boydton, Lat: 36.6676, Lon: -78.3875
IP: 20.75.94.112
CO₂ from energy is: 0.012521576 g
CO₂ from manufacturing (embodied carbon) is: 0.004085694 g
Carbon Intensity for this location: 404 gCO₂eq/kWh
SCI: 0.016607 gCO₂eq / pipeline run emitted

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@ArneTR ArneTR merged commit 73b44d6 into main Dec 19, 2024
4 checks passed
@ArneTR ArneTR deleted the totals-badge branch December 19, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant