green-coding-solutions / eco-ci-energy-estimation

Eco CI Energy estimation for Github Actions Runner VMs
MIT License
48 stars 10 forks source link

Changes the ip resolver from ip-api.com to ipapi.com because of https #78

Closed ribalba closed 3 weeks ago

ribalba commented 3 weeks ago

See discussion here https://github.com/green-coding-solutions/eco-ci-energy-estimation/pull/77

Having https should be standard IMHO. Thx to vszakats for bringing this to our attention

github-actions[bot] commented 3 weeks ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|6.62417|24.7645|1.7689|26| |Measurement #1|0.717143|12.3823|1.7689|7| |Sleep #2|0.858571|12.3823|1.7689|8| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ``` 🌳 CO2 Data: City: Boydton, Lat: 36.6534, Lon: -78.375 Carbon Intensity for this location: 394 gCO₂eq/kWh SCI: 0.009757 gCO₂eq / pipeline run emitted
vszakats commented 3 weeks ago

Patch for the README:

--- a/README.md
+++ b/README.md
@@ -109,7 +109,7 @@ jobs:
 - `send-data`: (optional) (default: true)
   - Send metrics data to metrics.green-coding.io to create and display badge, and see an overview of the energy of your CI runs. Set to false to send no data. The data we send are: the energy value and duration of measurement; cpu model; repository name/branch/workflow_id/run_id; commit_hash; source (GitHub or GitLab). We use this data to display in our green-metrics-tool front-end here: https://metrics.green-coding.io/ci-index.html
 - `show-carbon`: (optional) (default: true)
-  - Gets the location using http://ip-api.com
+  - Gets the location using https://ipapi.co/
   - Get the CO2 grid intensity for the location from https://www.electricitymaps.com/
   - Estimates the amount of carbon the measurement has produced
 - `display-table`: (optional) (default: true)
ribalba commented 3 weeks ago

Well spotted @vszakats thanks.

github-actions[bot] commented 3 weeks ago
Eco-CI Output: Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run 6.53583 24.7645 1.7689 25
Measurement #1 0.782857 12.3823 1.7689 7
Sleep #2 0.5 12.3823 1.7689 8

📈 Energy graph:


 2.00 ┼─────────────
       Watts over time

🌳 CO2 Data: City: Chicago, Lat: 41.8874, Lon: -87.6318 Carbon Intensity for this location: 410 gCO₂eq/kWh SCI: 0.010153 gCO₂eq / pipeline run emitted