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

Moving int to str #785

Closed ArneTR closed 4 months ago

ArneTR commented 4 months ago

This PR superseeds https://github.com/green-coding-solutions/green-metrics-tool/pull/780 and adds more str conversion for parameters that are allowed as int but must be str due to the nature of GMT shell outs.

Also some comments are added for clarity.

P.S.: This behaviour might be obsolte if we switch to an API based docker container orchestration contrary to the CLI atm

github-actions[bot] commented 4 months ago
Eco-CI Output: Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run 21.6721 1499.41 3.46284 442
Measurement #1 21.8815 1499.41 3.46284 434

📈 Energy graph:


 8.18 ┤                                                                                                                                ╭──╮
 7.54 ┤                                                                                                                             ╭╮ │  │
 6.90 ┤                                                                                                                             ││╭╯  │
 6.26 ┤                                                                                                            ╭╮          ╭──╮ │││   │
 5.62 ┤                ╭╮                                                                                          ││         ╭╯  │ │││   │
 4.97 ┤               ╭╯│     ╭╮                                                                                  ╭╯│    ╭╮   │   ╰╮│││   ╰╮
 4.33 ┤               │ ╰╮   ╭╯│                                 ╭──╮╭─╮                               ╭╮         │ ╰────╯│   │    ││╰╯    │             ╭╮╭╮
 3.69 ┤               │  ╰───╯ ╰──╮╭───────────────────╮╭────────╯  ││ ╰──╮ ╭──────────────────────────╯╰─────────╯       ╰╮ ╭╯    ╰╯      │    ╭────╮╭─╮│││╰─╮         ╭╮            ╭─────╮                     ╭╮ ╭─────╮╭───────────────────────────╮╭╮╭───╮╭─────╮ ╭──────────────╮                      ╭─────────╮╭────────────────╮╭───╮╭──╮╭───────────────────────────────╮ ╭──────────╮╭╮ ╭───╮╭╮╭─╮╭────╮╭╮╭─╮╭╮╭─╮╭────╮╭╮╭─╮╭─╮╭─╮╭─╮╭───
 3.05 ┤     ╭─╮ ╭╮    │           ╰╯                   ││           ╰╯    ╰╮│                                              │ │             │    │    ││ ╰╯││  │         ││╭╮       ╭─╮│     │         ╭──╮        ││ │     ││                           ││╰╯   ││     ╰╮│              │╭╮                    │         ╰╯                ╰╯   ╰╯  ╰╯                               │ │          ╰╯╰─╯   ││╰╯ ││    ╰╯╰╯ ╰╯╰╯ ││    ╰╯││ ╰╯ ││ ╰╯ ││
 2.41 ┤    ╭╯ │╭╯╰──╮╭╯                                ╰╯                  ││                                              ╰─╯             │    │    ╰╯   ╰╯  │         ││││       │ ││     │       ╭╮│  │        ││ │     ││                           ╰╯     ╰╯      ││              │││                   ╭╯                                                                     │ │                  ╰╯   ││              ╰╯      ╰╯    ││    ││
 1.77 ┼────╯  ╰╯    ╰╯                                                     ╰╯                                                              ╰────╯             ╰─────────╯╰╯╰───────╯ ╰╯     ╰───────╯╰╯  ╰────────╯╰─╯     ╰╯                                          ╰╯              ╰╯╰───────────────────╯                                                                      ╰─╯                       ╰╯                            ╰╯    ╰╯
                                                                                                                                                                                                                        Watts over time

🌳 CO2 Data: City: San Francisco, Lat: 37.783, Lon: -122.417 Carbon Intensity for this location: 147 gCO₂eq/kWh SCI: 0.220413 gCO₂eq / pipeline run emitted