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

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

Minimize tweaks #53

Closed dan-mm closed 6 months ago

dan-mm commented 7 months ago

Cleaner looking output.

Now also checks comments for both the user (github bot) + Eco-CI as a string within the message

github-actions[bot] commented 7 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|4.46714|24.7645|1.7689|23| |Measurement #1|5.5375|12.3823|1.7689|9| |Sleep #2|5.28|12.3823|1.7689|8| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ```
github-actions[bot] commented 7 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|4.87667|24.7645|1.7689|23| |Measurement #1|6.0075|12.3823|1.7689|9| |Sleep #2|5.575|12.3823|1.7689|9| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ```
github-actions[bot] commented 7 months ago
Eco-CI Output: Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run 5.51 24.7645 1.7689 24
Measurement #1 6.015 12.3823 1.7689 9
Sleep #2 5.64125 12.3823 1.7689 9

📈 Energy graph:


 2.00 ┼─────────────
       Watts over time
ArneTR commented 7 months ago

Can you clarify why there is a hardcoded API_BASE variable in the code?

The way I understand the add_var function it will update this variable. So will a user not always left with this API_BASE configured then? I thought.

The variable should be able to be set by the surrounding github actions workflow file, right? So if you can set it there, why is there a hardcoding option that you temporarily patched in the first place?

dan-mm commented 7 months ago

The API_BASE you're referring to is for the green metrics tool API, not the github API. So it shouldn't be configured by the github workflow (that only edits the github API base, which is no longer hardcoded). Maybe it could use a rename to GMT_API_BASE or something to clarify, now that we query multiple API endpoints.