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
143 stars 19 forks source link

Error handling modular #743

Closed ArneTR closed 3 months ago

ArneTR commented 3 months ago

This PR modularizes the error handling.

Before we had the issue that emails were sent sync. If the email vendors fails the API would hang.

This PR refactores the old jobs table to a proper versatile queuing mechanism. Run and Email are now implemented again.

github-actions[bot] commented 3 months ago
Eco-CI Output: Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run 23.7541 1294.15 3.62507 366
Measurement #1 24.1018 1294.15 3.62507 357

📈 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: Boydton, Lat: 36.677696, Lon: -78.37471 Carbon Intensity for this location: 357 gCO₂eq/kWh CO2eq emitted for this job: 0.462012 gCO₂eq