Skip to content

Adds skip_checks to providers #566

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

Merged
merged 18 commits into from
Jan 1, 2024
Merged

Adds skip_checks to providers #566

merged 18 commits into from
Jan 1, 2024

Conversation

ribalba
Copy link
Member

@ribalba ribalba commented Nov 29, 2023

No description provided.

@ribalba ribalba requested a review from ArneTR November 29, 2023 19:53
Copy link

github-actions bot commented Nov 29, 2023

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run 9.67552 1565.03 2.48024 639
Measurement #1 9.72426 1565.03 2.48024 633

📈 Energy graph:

 
 7.73 ┤                                                             ╭╮
 7.14 ┤                                          ╭╮                 ││
 6.54 ┤                                         ╭╯│            ╭╮   ││
 5.94 ┤                                         │ │            ││   ││╭╮
 5.35 ┤        ╭╮╭╮                             │ │          ╭╮│╰─╮╭╯│││
 4.75 ┤        ││││                             │ ╰──────╮   │╰╯  ││ ╰╯│
 4.16 ┤     ╭──╯╰╯╰╮      ╭─╮ ╭╮  ╭─╮   ╭──╮    │        │   │    ╰╯   ╰╮        ╭╮╭──╮                          ╭─╮╭╮╭╮╭╮    ╭╮           ╭╮           ╭╮                                                ╭╮                                    ╭╮         ╭╮           ╭─╮                         ╭╮                        ╭╮                        ╭─╮                        ╭─╮                         ╭╮                          ╭╮                                                 ╭╮                                   ╭╮                                                                                ╭──╮                         ╭╮
 3.56 ┤    ╭╯      ╰──────╯ ╰─╯╰──╯ ╰───╯  ╰─╮╭─╯        ╰╮  │          │       ╭╯╰╯  ╰╮        ╭──╮        ╭╮ ╭─╯ ╰╯╰╯╰╯╰────╯╰─╮         │╰─╮         │╰─╮        ╭──╮         ╭─╮         ╭──╮         │╰─╮        ╭──╮         ╭─╮         ╭╯│         │╰─╮         │ ╰─╮                  ╭╮ ╭─╯╰╮                  ╭╮ ╭─╯╰╮                   ╭╮╭─╯ │        ╭─╮         ╭╮ ╭╯ ╰╮        ╭╮          ╭╮ ╭╯╰╮         ╭╮╭╮        ╭╮╭─╯╰╮        ╭─╮         ╭╮ ╭──╮         ╭─╮         │╰─╮         ╭─╮         ╭─╮         │╰─╮        ╭──╮╭╮          ╭──╮        ╭─╮           ╭─╮         ╭╮            ╭─╯  ╰╮         ╭╮         ╭╮ ╭╯│
 2.96 ┤    │                                 ││           │  │          │       │      │        │  │        ││ │                 │         │  │         │  │        │  │         │ │         │  │         │  │        │  │         │ │         │ │         │  │         │   │        ╭╮        ││ │   │         ╭╮       │╰╮│   │         ╭╮       ╭╯││   │        │ ╰╮        │╰╮│   │        │╰─╮        ││ │  │        ╭╯│││       ╭╯││   │        │ │╭╮       │╰╮│  │         │ │         │  │         │ │         │ │         │  │        │  │││          │  │        │ ╰╮          │ ╰╮        ││╭╮          │     │        ╭╯│         ││ │ │
 2.37 ┤    │                                 ╰╯           │ ╭╯          │       │      │        │  │        ││ │                 │         │  │         │  │        │  │        ╭╯ │         │  │         │  │        │  │         │ │         │ │         │  │         │   │        ││        │╰╮│   │         ││       │ ││   │         ││       │ ││   │        │  ╰╮       │ ││   │        │  │        ││ │  │        │ │││       │ ││   │        │ ╰╯│       │ ││  │         │ │         │  │         │ │         │ │        ╭╯  │        │  │││       ╭╮ │  │        │  │          │  │       ╭╯│││       ╭╮ │     │        │ ╰╮        ││ │ │        ╭
 1.77 ┼────╯                                              ╰─╯           ╰───────╯      ╰────────╯  ╰────────╯╰─╯                 ╰─────────╯  ╰─────────╯  ╰────────╯  ╰────────╯  ╰─────────╯  ╰─────────╯  ╰────────╯  ╰─────────╯ ╰─────────╯ ╰─────────╯  ╰─────────╯   ╰────────╯╰────────╯ ╰╯   ╰─────────╯╰───────╯ ╰╯   ╰─────────╯╰───────╯ ╰╯   ╰────────╯   ╰───────╯ ╰╯   ╰────────╯  ╰────────╯╰─╯  ╰────────╯ ╰╯╰───────╯ ╰╯   ╰────────╯   ╰───────╯ ╰╯  ╰─────────╯ ╰─────────╯  ╰─────────╯ ╰─────────╯ ╰────────╯   ╰────────╯  ╰╯╰───────╯╰─╯  ╰────────╯  ╰──────────╯  ╰───────╯ ╰╯╰───────╯╰─╯     ╰────────╯  ╰────────╯╰─╯ ╰────────╯
                                                                                                                                                                                                                                                                                                                           Watts over time

Copy link
Member

@ArneTR ArneTR left a comment

Choose a reason for hiding this comment

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

I left a comment for a IMHO opionin missing guard clause.

Also I do see the need for having the GMT work when PowerHog is installed, but would like to brainstorm a bit if there cannot be an alternative solution other than having this waiting loop.

In the end we have the case that the Hog or another process might need the powermetrics support. Even if we instruct the GMT to kill it by force the daemon restarts it so quickly, that there is no way of getting it properly shut down.

So we run into an unsolvable conflict: If Hog is present the measurement with the GMT will be less useful. If we force it the GMT measurement will be less helpful, but at least the HOG data is uninterrupted (if fix proposed for the except block is applied).
So I see the argument for having this mode. It keeps at least one of the programs data good.

However it would be nice if the user can also opt for the case of favoring the GMT run over the HOG data. This is at the moment done by having the flag not set and getting a warning.

So the case in order to have "both", aka the HOG keeps running and the GMT will only get some overhead, but will not run into conflict, we could try the route to supply "stop_profiling" with a longer waiting amount. At the moment this waits for 5 secods for the forked process. Maybe if we use 60+ seconds here, and not in the loop after killall we get better results and can run both side by side?


# We need to give the OS a second to flush
time.sleep(1)
if self._skip_check:
Copy link
Member

Choose a reason for hiding this comment

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

If you run into a Permission error in the block before this (the except block) you would still kill the process, which is likely not what you want with that code. I think that should also be guard-claused.

Copy link

github-actions bot commented Dec 5, 2023

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run 10.4733 1772.76 2.56922 705
Measurement #1 10.6069 1772.76 2.56922 692

📈 Energy graph:

 
 7.66 ┤                                                                                           ╭╮                         ╭╮
 7.07 ┤                                                                                           ││                         ││
 6.48 ┤                                                                                           │╰╮                   ╭╮   ││╭╮
 5.89 ┤                                                ╭╮                                         │ │                   ││  ╭╯│││
 5.31 ┤                                                ││                                         │ │                 ╭─╯╰─╮│ │││
 4.72 ┤                                              ╭╮││                           ╭─╮           │ │  ╭─╮╭╮          │    ││ ╰╯│            ╭╮
 4.13 ┤     ╭──╮ ╭──╮╭─╮╭╮╭─╮ ╭╮    ╭─╮╭╮    ╭─╮╭╮ ╭─╯││╰╮  ╭─╮   ╭╮        ╭───╮╭╮╭╯ │    ╭╮╭─╮╭╮│ ╰──╯ ╰╯╰╮         │    ╰╯   │        ╭──╮│╰╮                        ╭╮╭─╮╭╮╭─╮╭─╮╭╮         ╭╮╭╮         ╭╮           ╭╮                                    ╭╮                        ╭╮                      ╭╮           ╭─╮                        ╭╮                        ╭─╮                       ╭─╮                         ╭─╮                         ╭─╮                          ╭─╮                                                                                                   ╭╮                                                                   ╭──╮╭─╮
 3.54 ┤    ╭╯  ╰─╯  ╰╯ ╰╯╰╯ ╰─╯╰────╯ ╰╯╰────╯ ╰╯╰─╯  ╰╯ ╰╮ │ ╰───╯╰────────╯   ╰╯╰╯  ╰────╯╰╯ ╰╯╰╯         │        ╭╯         ╰╮       │  ╰╯ │         ╭╮╭╮        ╭╮ │╰╯ ╰╯╰╯ ╰╯ │││         │╰╯│         │╰─╮         │╰╮         ╭──╮         ╭──╮         │╰╮         ╭──╮         ╭╯│         ╭─╮         ╭╯╰╮         ╭╯ ╰╮         ╭╮        ╭╮ ╭╯╰─╮                  ╭╮ ╭╯ ╰╮                  ╭╮ ╭╯ ╰╮        ╭─╮         ╭╮ ╭╯ ╰╮         ╭╮         ╭╮ ╭╯ ╰╮        ╭─╮         ╭╮ ╭─╯ │        ╭─╮╭╮        ╭╮╭──╮          ╭╮         ╭──╮         ╭─╮          ╭╮         ╭───╮         │╰─╮            ╭──╮        ╭─╮           ╭──╮        ╭╮            ╭╯  ╰╯ │         ╭╮          ╭╮╭─╮
 2.95 ┤    │                                              ╰╮│                                               │        │           │       │     ╰╮        ││││        ││ │           │││         │  │         │  │         │ │         │  │         │  │        ╭╯ │         │  │         │ │         │ ╰╮        │  │         │   │         ││        ││╭╯   │        ╭╮        ││ │   │                  ││ │   │        │ │         │╰╮│   │        ╭╯│         ││ │   │        │ │╭╮       │╰╮│   │        │ │││       ╭╯││  ╰╮        ╭╯╰╮        │  │         │ │         ╭╯╰╮        │   │        ╭╯  │         ╭╮ │  │        │ ╰╮          │  │        │╰─╮          │      │        ╭╯│╭╮       ╭╯││ │
 2.36 ┤    │                                               ││                                               ╰╮       │           │       │      │       ╭╯│││        ││ │           ╰╯│         │  │         │  │         │ ╰╮        │  │         │  │        │  ╰╮        │  │        ╭╯ │         │  │        │  ╰─╮       │   │         ││       ╭╯││    │        ││        ││ │   │        ╭╮        │╰╮│   │        │ ╰─╮       │ ││   │        │ ╰╮        ││ │   │        │ ╰╯│       │ ││   │        │ │││       │ ││   │        │  │        │  ╰╮        │ ╰╮        │  │        │   │        │   ╰─╮       ││ │  │       ╭╯  │          │  │       ╭╯  │          │      ╰╮       │ ╰╯│       │ ││ ╰╮
 1.77 ┼────╯                                               ╰╯                                                ╰───────╯           ╰───────╯      ╰───────╯ ╰╯╰────────╯╰─╯             ╰─────────╯  ╰─────────╯  ╰─────────╯  ╰────────╯  ╰─────────╯  ╰────────╯   ╰────────╯  ╰────────╯  ╰─────────╯  ╰────────╯    ╰───────╯   ╰─────────╯╰───────╯ ╰╯    ╰────────╯╰────────╯╰─╯   ╰────────╯╰────────╯ ╰╯   ╰────────╯   ╰───────╯ ╰╯   ╰────────╯  ╰────────╯╰─╯   ╰────────╯   ╰───────╯ ╰╯   ╰────────╯ ╰╯╰───────╯ ╰╯   ╰────────╯  ╰────────╯   ╰────────╯  ╰────────╯  ╰────────╯   ╰────────╯     ╰───────╯╰─╯  ╰───────╯   ╰──────────╯  ╰───────╯   ╰──────────╯       ╰───────╯   ╰───────╯ ╰╯  ╰────────
                                                                                                                                                                                                                                                                                                                                                        Watts over time

@ribalba ribalba requested a review from ArneTR December 6, 2023 18:15
Copy link

github-actions bot commented Dec 6, 2023

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run 9.63113 1570.89 2.48166 640
Measurement #1 9.68472 1570.89 2.48166 634

📈 Energy graph:

 
 7.82 ┤                                           ╭╮
 7.22 ┤                                           ││                  ╭╮
 6.61 ┤                                           ││                  ││
 6.01 ┤                                           ││             ╭╮  ╭╯│╭╮
 5.40 ┤                                    ╭╮    ╭╯│            ╭╯╰╮ │ │││
 4.80 ┤         ╭╮     ╭╮                  ││    │ ╰╮ ╭─╮╭╮    ╭╯  ╰╮│ ╰╯│            ╭╮
 4.19 ┤        ╭╯╰─╮  ╭╯│ ╭─╮     ╭╮    ╭──╯╰╮   │  ╰─╯ ╰╯╰╮   │    ││   │        ╭╮  ││                          ╭╮  ╭╮                                                                                                                                               ╭╮                         ╭╮                      ╭──╮                        ╭╮                          ╭─╮                         ╭─╮                          ╭╮                                                                                                                                                                           ╭─╮
 3.58 ┤    ╭───╯   ╰──╯ ╰─╯ ╰─────╯╰────╯    │  ╭╯         │  ╭╯    ╰╯   ╰╮       │╰──╯╰╮         ╭╮╭╮        ╭╮ ╭╯╰──╯╰──────╮         ╭──╮         ╭──╮         ╭─╮         ╭──╮         ╭─╮         ╭──╮         ╭──╮        ╭──╮         ╭─╮         ╭──╮         ╭╯╰╮         ╭╮        ╭╮ ╭─╯╰╮                   ╭╮│  ╰─╮                  ╭╮ ╭╯╰─╮         ╭╮         ╭╮ ╭╯ ╰╮         ╭╮         ╭╮ ╭╯ ╰╮        ╭─╮          ╭╮╭─╯╰╮        ╭─╮╭╮        ╭╮╭──╮          ╭╮         ╭──╮          ╭╮          ╭╮         ╭──╮         ╭──╮╭╮          ╭──╮        ╭─╮           ╭──╮         ╭╮           ╭───╯ ╰╮        ╭─╮         ╭╮ ╭─╮
 2.98 ┤    │                                 ╰──╯          ╰╮ │           │       │     │         ││││        ││ │            ╰╮        │  │         │  │         │ │         │  │         │ ╰╮        │  │         │  │        │  │         │ │         │  │         │  ╰╮        ││        ││ │   │         ╭╮       ╭╯││    │                  ││ │   │        ╭╯│         │╰╮│   │        ╭╯│         ││ │   │        │ │╭╮       ╭╯││   │        │ │││        │││  │         ╭╯╰╮        │  │         ╭╯│         ╭╯│         │  ╰╮        │  │││          │  │        │ │           │  │        ╭╯│           │      │        │ │         ││ │ │        ╭
 2.37 ┤    │                                                │ │           │       │     ╰╮       ╭╯│││        ││ │             │        │  ╰╮        │  │         │ ╰╮        │  │     ╭╮ ╭╯  │        │  │         │  │        │  │         │ │         │  │         │   │        ││        ││ │   │         ││       │ ││    │        ╭╮        ││ │   │       ╭╯ ╰─╮       │ ││   │        │ │╭╮       │╰╮│   │        │ ╰╯│       │ ││   │        │ │││       ╭╯││  ╰╮        │  │        │  │         │ │         │ │         │   │       ╭╯  ╰╯│        ╭╮│  │        │ ╰╮          │  │        │ ╰╮        ╭╮│      │        │ ╰╮        ││ │ ╰╮       │
 1.77 ┼────╯                                                ╰─╯           ╰───────╯      ╰───────╯ ╰╯╰────────╯╰─╯             ╰────────╯   ╰────────╯  ╰─────────╯  ╰────────╯  ╰─────╯╰─╯   ╰────────╯  ╰─────────╯  ╰────────╯  ╰─────────╯ ╰─────────╯  ╰─────────╯   ╰────────╯╰────────╯╰─╯   ╰─────────╯╰───────╯ ╰╯    ╰────────╯╰────────╯╰─╯   ╰───────╯    ╰───────╯ ╰╯   ╰────────╯ ╰╯╰───────╯ ╰╯   ╰────────╯   ╰───────╯ ╰╯   ╰────────╯ ╰╯╰───────╯ ╰╯   ╰────────╯  ╰────────╯  ╰─────────╯ ╰─────────╯ ╰─────────╯   ╰───────╯     ╰────────╯╰╯  ╰────────╯  ╰──────────╯  ╰────────╯  ╰────────╯╰╯      ╰────────╯  ╰────────╯╰─╯  ╰───────╯
                                                                                                                                                                                                                                                                                                                            Watts over time

count += 1
if count >= 60:
subprocess.check_output('sudo /usr/bin/killall -9 powermetrics', shell=True)
raise RuntimeError('powermetrics had to be killed with kill -9. Values can not be trusted!')
Copy link
Member

Choose a reason for hiding this comment

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

Actually what exactly happens in this case? If powermetrics is killed and then a Runtime error is raised the measurement is broken in any case, as no processing is done anymore, right?
Wouldn't it be better to just continue parsing the values and issue a warning that data might be missing as no flusing has occured?

Copy link
Member Author

Choose a reason for hiding this comment

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

I also thought about this. The problem is that we don't really know how much data has actually been flushed. If the process hasn't died after 60 seconds something bad has happened and I would argue the system was in an inconsistent state. So I wanted to fail big and not have any values available at all.

@ribalba
Copy link
Member Author

ribalba commented Dec 20, 2023

@ArneTR feedback incorporated and added the utf check

@ArneTR
Copy link
Member

ArneTR commented Dec 20, 2023

k, looks good. re-running the tests again as the networkProxyProvider is having some hickups on Github lately ... this is afaik a transient error

@ArneTR
Copy link
Member

ArneTR commented Dec 21, 2023

github shows an empty merge force-push for your last commit. Was that indended?

@ribalba
Copy link
Member Author

ribalba commented Dec 21, 2023

For some reason GitHub is not showing the merge commit files. In my local git they are showing up. Chose a graphical representation to make it easier to see right away. I also didn't force push. I simply did
git merge main && git push

Screenshot 2023-12-21 at 08 45 55

@ArneTR
Copy link
Member

ArneTR commented Dec 21, 2023

Weird that git shows the merge incorrectly. But I can see it locally just fine.

However I do not understand your fix. The error is not actually empty. Tinyproxy seems to fail.

Did you see that line? https://github.com/green-coding-berlin/green-metrics-tool/actions/runs/7282733628/job/19851217512#step:5:4931

RuntimeError: Stderr on NetworkConnectionsProxyContainerProvider was NOT empty: b'/usr/bin/tinyproxy: Could not create listening sockets.\n'

Let's phone tomorrow about it.

@ribalba
Copy link
Member Author

ribalba commented Dec 22, 2023

This pr has blown out of proportion for what it actually set out to do. Sorry for the chaos. So now it also fixes testing under MacOS and fixes quite a few things with power metrics like the wrong return codes when there was no power metrics process running. Also it fixes a few smaller errors like that powermetrics was called with -o and piped into a file which in some cases cases the file to be corrupted. Also it fixes std output being a byte stream.

@ribalba
Copy link
Member Author

ribalba commented Dec 22, 2023

@ArneTR ready for your comments.

I have decided not to implement file support/ or non redirection as it will just blow up the base.py even more. I have opted for catching the case in which the file is empty and returning. Sending a SIGIO does nothing but I am keeping it in as it is good practice.

Copy link

github-actions bot commented Dec 22, 2023

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run 10.2864 1661.3 2.548 659
Measurement #1 10.3194 1661.3 2.548 653

📈 Energy graph:

 
 7.78 ┤                                     ╭╮                 ╭╮
 7.18 ┤                                     ││                 ││
 6.58 ┤                                     ││            ╭╮   ││╭╮
 5.97 ┤                                     │╰╮           ││   ││││
 5.37 ┤                                     │ │          ╭╯╰─╮╭╯│││
 4.77 ┤         ╭─╮   ╭╮                    │ │  ╭───╮   │   ││ ╰╯│            ╭╮
 4.17 ┤     ╭╮╭─╯ │  ╭╯╰─╮     ╭─╮  ╭──╮   ╭╯ ╰──╯   │  ╭╯   ╰╯   │        ╭╮  ││                                      ╭╮             ╭╮           ╭╮                                       ╭╮  ╭────╮                       ╭╮                                                                ╭╮                         ╭╮                        ╭╮                        ╭─╮                          ╭╮                          ╭╮                           ╭╮                                                                                         ╭╮                                                                                  ╭──╮                          ╭
 3.57 ┤    ╭╯╰╯   ╰──╯   ╰─────╯ ╰──╯  ╰─╮╭╯         ╰╮ │         ╰╮       │╰──╯╰─╮        ╭─╮         ╭╮ ╭────────────╯╰─╮         ╭─╯│         ╭─╯╰╮        ╭──╮         ╭──╮         ╭───╯╰──╯    ╰─────────────╮         │╰─╮         ╭──╮         ╭──╮         ╭─╮          ╭──╮         ╭╯╰─╮        ╭╮        ╭╮ ╭─╯╰╮                   ╭╮ ╭╯╰─╮                  ╭╮ ╭╯ ╰╮         ╭╮╭╮        ╭╮ ╭╯╰─╮        ╭─╮         ╭╮ ╭╯╰─╮        ╭─╮╭╮        ╭╮╭─╯╰─╮        ╭──╮        ╭╮ ╭──╮          ╭─╮         ╭──╮         ╭─╮          ╭─╮         │╰─╮         ╭──╮            ╭───╮        ╭─╮           ╭──╮         ╭╮           ╭─╯  ╰─╮        ╭─╮         ╭╮ ╭╯
 2.97 ┤    │                             ││           │ │          │       │      │        │ │         ││ │               │         │  ╰╮        │   │        │  │         │  │         │                          │         │  │         │  │         │  │         │ ╰╮        ╭╯  │        ╭╯   │        ││        ││ │   ╰╮        ╭╮        ││ │   │                  ││ │   │        ╭╯│││        ││ │   │        │ │         ││ │   │        │ │││        │││    │        │  │        ││ │  │         ╭╯ │         │  │         │ │          │ │         │  ╰╮        │  ╰─╮          │   │        │ │           │  │        ╭╯│           │      │        │ │         ││ │
 2.37 ┤    │                             ││           │ │          │       │      │       ╭╯ ╰─╮       │╰╮│               │         │   │        │   │        │  ╰╮        │  │         │                          │         │  ╰╮        │  │         │  │         │  │        │   │        │    │        ││        ││ │    │        ││        ││ │   │                  │╰╮│   │        │ ╰╯│        ││ │   │        │ ╰╮        ││ │   │        │ │││       ╭╯││    │       ╭╯  │        ││ │  ╰╮        │  │         │  │         │ ╰╮        ╭╯ │         │   │       ╭╯    │        ╭╮│   │       ╭╯ ╰╮          │  │        │ ╰╮          │      │        │ │╭╮       │╰╮│
 1.77 ┼────╯                             ╰╯           ╰─╯          ╰───────╯      ╰───────╯    ╰───────╯ ╰╯               ╰─────────╯   ╰────────╯   ╰────────╯   ╰────────╯  ╰─────────╯                          ╰─────────╯   ╰────────╯  ╰─────────╯  ╰─────────╯  ╰────────╯   ╰────────╯    ╰────────╯╰────────╯╰─╯    ╰────────╯╰────────╯╰─╯   ╰──────────────────╯ ╰╯   ╰────────╯   ╰────────╯╰─╯   ╰────────╯  ╰────────╯╰─╯   ╰────────╯ ╰╯╰───────╯ ╰╯    ╰───────╯   ╰────────╯╰─╯   ╰────────╯  ╰─────────╯  ╰─────────╯  ╰────────╯  ╰─────────╯   ╰───────╯     ╰────────╯╰╯   ╰───────╯   ╰──────────╯  ╰────────╯  ╰──────────╯      ╰────────╯ ╰╯╰───────╯ ╰╯
                                                                                                                                                                                                                                                                                                                                     Watts over time

Copy link
Member

@ArneTR ArneTR left a comment

Choose a reason for hiding this comment

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

I am now done with all my other PRs and now ready to tackle this.

It will require quite some merging as soon as the other PRs are aready as process killing and UTF-8 stderr are now processed differently.

I will take this on, but need a feedback on the comments I have put in here in this new review.

@@ -181,7 +217,14 @@ def read_metrics(self, run_id, containers=None):
def get_stderr(self):
stderr = super().get_stderr()

if stderr is not None and str(stderr).find('proc_pid') != -1:
if stderr is not None and str(stderr).find('proc_pid') != -1 :
Copy link
Member

Choose a reason for hiding this comment

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

Will that really do what we want? How I understand it you are returning here if the string "proc_pid" is in stderr.

However actually we want to return if ONLY this string is in stderr, not?

So we would have to iterate over all the lines and match?

# strings of powermetrics doesn't show anything. There also seems to be no correlation with the interval.
# A shame we can't look into the code and figure this one out. For now we just ignore it as we don't really
# have any other chance to debug.
if stderr is not None and str(stderr).find('Second underflow occured') != -1 :
Copy link
Member

Choose a reason for hiding this comment

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

Will that really do what we want? How I understand it you are returning here if the string "Second underflow" is in stderr.

However actually we want to return if ONLY this string is in stderr, not?

So we would have to iterate over all the lines and match?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ArneTR good point. Fixed please review

Copy link

github-actions bot commented Dec 24, 2023

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run 10.6488 1680.92 2.57021 662
Measurement #1 10.6708 1680.92 2.57021 656

📈 Energy graph:

 
 7.78 ┤                                       ╭╮                ╭╮
 7.18 ┤                                       ││                ││
 6.58 ┤                                       ││                ││
 5.98 ┤          ╭╮                           ││          ╭╮╭╮  │╰╮
 5.38 ┤          ││                           │╰╮         │╰╯╰╮ │ ╰─╮
 4.77 ┤        ╭╮││                     ╭╮   ╭╯ ╰╮╭─╮╭╮   │   │ │   │            ╭╮
 4.17 ┤      ╭─╯╰╯╰╮    ╭─╮╭─╮   ╭╮   ╭─╯│   │   ╰╯ ╰╯╰╮  │   ╰─╯   │        ╭╮╭╮││                                  ╭╮  ╭╮           ╭╮                                                      ╭╮  ╭────╮                                                                           ╭╮           ╭─╮                         ╭╮                        ╭─╮                        ╭╮                          ╭─╮                         ╭─╮                          ╭╮                                                                                                                       ╭╮                                                     ╭─╮
 3.57 ┤    ╭─╯     ╰────╯ ╰╯ ╰───╯╰───╯  ╰─╮╭╯         │ ╭╯         │       ╭╯╰╯╰╯╰─╮        ╭─╮         ╭╮ ╭────────╯╰──╯╰─╮         │╰─╮         ╭───╮        ╭──╮         ╭──╮         ╭───╯╰──╯    ╰─────────────╮         ╭───╮        ╭──╮         ╭──╮         ╭──╮         │╰─╮         │ ╰─╮         ╭╮        ╭╮╭─╯╰─╮                  ╭╮ ╭╯ ╰╮                   ╭╮ ╭╯╰─╮        ╭─╮         ╭╮ ╭╯ ╰╮         ╭╮          ╭╮╭╯ ╰╮         ╭──╮        ╭╮ ╭╯╰─╮        ╭─╮╭╮        ╭╮╭───╮         ╭─╮         ╭──╮          ╭─╮         ╭─╮         ╭───╮        ╭───╮            │╰─╮        ╭─╮           ╭──╮        ╭─╮           ╭──╯ ╰─╮         ╭╮          ╭╮╭─
 2.97 ┤    │                               ││          ╰╮│          │       │       │        │ ╰╮        ││ │               │         │  │         │   │        │  │         │  │         │                          ╰╮        │   │        │  │         │  │         │  │         │  │         │   │         ││       ╭╯││    │                  ││ │   │         ╭╮        ││ │   │        │ │         ││ │   │        ╭╯│         ╭╯││   ╰╮        │  │        ││ │   │        │ │││       ╭╯││   │         │ │         │  ╰╮         │ │         │ │         │   │        │   │╭╮          │  │        │ │           │  │        │ │╭╮         │      │        ╭╯│╭╮       ╭╯││
 2.37 ┤    │                               ╰╯           ││          │       │       │       ╭╯  │        │╰╮│               │         │  ╰╮        │   │        │  ╰╮        │  │         │                           │        │   │        │  ╰╮        │  │         │  │         │  │         │   │         ││       │ ││    │         ╭╮       │╰╮│   ╰╮        ││       ╭╯│╭╯   │       ╭╯ ╰─╮       │╰╮│   ╰╮       │ ╰─╮       │ ││    │       ╭╯  │        ││ │   │        │ │││       │ ││   │         │ ╰╮        │   │        ╭╯ │         │ ╰╮        │   │        │   │││       ╭╮ │  │        │ ╰╮          │  │        │ │││         │      ╰╮       │ ╰╯│       │ ││
 1.77 ┼────╯                                            ╰╯          ╰───────╯       ╰───────╯   ╰────────╯ ╰╯               ╰─────────╯   ╰────────╯   ╰────────╯   ╰────────╯  ╰─────────╯                           ╰────────╯   ╰────────╯   ╰────────╯  ╰─────────╯  ╰─────────╯  ╰─────────╯   ╰─────────╯╰───────╯ ╰╯    ╰─────────╯╰───────╯ ╰╯    ╰────────╯╰───────╯ ╰╯    ╰───────╯    ╰───────╯ ╰╯    ╰───────╯   ╰───────╯ ╰╯    ╰───────╯   ╰────────╯╰─╯   ╰────────╯ ╰╯╰───────╯ ╰╯   ╰─────────╯  ╰────────╯   ╰────────╯  ╰─────────╯  ╰────────╯   ╰────────╯   ╰╯╰───────╯╰─╯  ╰────────╯  ╰──────────╯  ╰────────╯ ╰╯╰─────────╯       ╰───────╯   ╰───────╯ ╰╯
                                                                                                                                                                                                                                                                                                                                      Watts over time

ArneTR added 6 commits January 1, 2024 08:44
…ng-berlin/green-metrics-tool into adds-skip-checks-to-providers

* 'adds-skip-checks-to-providers' of github.com:green-coding-berlin/green-metrics-tool:
  pylint fixes and better error handling
* main: (23 commits)
  System check providers running (#619)
  Stderr is now by default UTF-8 (#624)
  Refactored kill/killpg mechanism to be unified and actually fail on n… (#625)
  Command fix. Must be list append
  Refactorings
  Moved tinyproxy out of if clause
  Refactoring for error messages and security fix for path echoing (#636)
  GMT color via own commit hash (#634)
  Hotfix for branch not main
  Non-Blocking starlette body read (#633)
  Bump fastapi from 0.105.0 to 0.108.0 (#632)
  Updated XGBoost submodule
  Bump pydantic from 2.5.2 to 2.5.3 (#628)
  Added stddev to timeline (#627)
  Disable tinyproxy systemd service (#623)
  Text change
  Value formatting on status page
  Normalized URL for machines endpoint
  Less confusing error messages
  Status has now a waiting time (#599)
  ...
* main:
  Disabled second PSU provider for VM tests
Copy link

github-actions bot commented Jan 1, 2024

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run 10.536 1688.77 2.57434 664
Measurement #1 10.5661 1688.77 2.57434 658

📈 Energy graph:

 
 7.77 ┤                                     ╭╮                 ╭╮
 7.17 ┤                                     ││                 ││
 6.57 ┤                                     ││                 │╰╮
 5.97 ┤                                     │╰╮           ╭╮   │ │╭╮
 5.37 ┤                                     │ │          ╭╯╰─╮ │ ╰╯│
 4.77 ┤                                     │ │  ╭─╮╭╮   │   │ │   │            ╭╮
 4.17 ┤     ╭─╮    ╭─╮ ╭╮  ╭───╮     ╭─╮   ╭╯ ╰──╯ ╰╯╰╮ ╭╯   ╰╮│   │        ╭╮╭╮││                            ╭╮  ╭╮    ╭╮ ╭╮                                                                   ╭╮  ╭─────╮                       ╭╮                                                               ╭─╮                         ╭╮                        ╭─╮                        ╭╮                          ╭╮                          ╭╮                          ╭─╮                                                  ╭╮                                                  ╭╮                                                                     ╭──╮          ╭╮             ╭
 3.57 ┤    ╭╯ ╰────╯ ╰─╯╰──╯   ╰─────╯ ╰─╮╭╯          │ │     ╰╯   │        │╰╯╰╯╰─╮        ╭─╮         ╭╮ ╭──╯╰──╯╰────╯╰─╯╰─╮         ╭───╮        ╭───╮         ╭──╮        ╭──╮         ╭───╯╰──╯     ╰─────────────╮         │╰─╮         ╭──╮         ╭──╮         ╭──╮         ╭──╮         │ ╰─╮                  ╭╮ ╭─╯╰─╮                  ╭╮ ╭╯ ╰╮                   ╭╮╭─╯╰─╮        ╭╮╭╮        ╭╮ ╭╯╰─╮        ╭─╮         ╭╮ ╭╯╰─╮        ╭─╮         ╭╮ ╭╯ ╰╮         ╭╮╭╮        ╭╮╭───╮         ╭─╮         │╰─╮          ╭─╮         ╭─╮         ╭───╮        ╭╯╰──╮          ╭───╮        ╭╮           ╭──╮         ╭╮            ╭──╯  ╰╮         ││         ╭╮ ╭╯
 2.97 ┤    │                             ╰╯           │ │          │       ╭╯      │        │ ╰╮        ││ │                  │         │   │        │   │         │  │        │  ╰╮        │                           │         │  │         │  │         │  │         │  │        ╭╯  │         │   │         ╭╮       │╰╮│    │        ╭╮        ││ │   │         ╭╮       ╭╯││    │        │╰╯│        ││ │   │        │ │         ││ │   │        │ ╰╮        ││ │   │        ╭╯│││       ╭╯││   │         │ │         │  ╰╮         │ │         │ ╰╮        │   │        │    │          │   │        ││╭╮         │  ╰╮        ││╭╮         ╭╯      ╰╮        ││╭╮       │╰╮│
 2.37 ┤    │                                          ╰╮│          │       │       │       ╭╯  ╰╮       │╰╮│                  ╰╮        │   │        │   │         │  │        │   │        │                           │         │  ╰╮        │  │         │  │         │  │        │   │        ╭╯   │        ╭╯│       │ ╰╯    │        ││        ││ │   │         ││       │ ││    │       ╭╯  │        ││ │   │        │ ╰╮        ││ │   │        │  │        │╰╮│   ╰╮       │ │││       │ ││   │         │ │         │   │        ╭╯ │         │  │        │   │        │    │        ╭╮│   │       ╭╯╰╯│         │   │       ╭╯│││         │        │       ╭╯│││       │ ││
 1.77 ┼────╯                                           ╰╯          ╰───────╯       ╰───────╯    ╰───────╯ ╰╯                   ╰────────╯   ╰────────╯   ╰─────────╯  ╰────────╯   ╰────────╯                           ╰─────────╯   ╰────────╯  ╰─────────╯  ╰─────────╯  ╰────────╯   ╰────────╯    ╰────────╯ ╰───────╯       ╰────────╯╰────────╯╰─╯   ╰─────────╯╰───────╯ ╰╯    ╰───────╯   ╰────────╯╰─╯   ╰────────╯  ╰────────╯╰─╯   ╰────────╯  ╰────────╯ ╰╯    ╰───────╯ ╰╯╰───────╯ ╰╯   ╰─────────╯ ╰─────────╯   ╰────────╯  ╰─────────╯  ╰────────╯   ╰────────╯    ╰────────╯╰╯   ╰───────╯   ╰─────────╯   ╰───────╯ ╰╯╰─────────╯        ╰───────╯ ╰╯╰───────╯ ╰╯
                                                                                                                                                                                                                                                                                                                                       Watts over time

@ArneTR ArneTR merged commit 26b1506 into main Jan 1, 2024
@ArneTR ArneTR deleted the adds-skip-checks-to-providers branch January 1, 2024 10:18
ArneTR added a commit that referenced this pull request Jan 1, 2024
* main:
  Adds skip_checks to providers (#566)
  Bump pytest from 7.4.3 to 7.4.4 (#639)
  Disabled second PSU provider for VM tests
  System check providers running (#619)
  Stderr is now by default UTF-8 (#624)
  Refactored kill/killpg mechanism to be unified and actually fail on n… (#625)
  Command fix. Must be list append
  Refactorings
  Moved tinyproxy out of if clause
  Refactoring for error messages and security fix for path echoing (#636)
ArneTR added a commit that referenced this pull request Jan 1, 2024
* main:
  Dev mode (#637)
  Hotfix: resolutions -> resolution
  Adds skip_checks to providers (#566)
  Bump pytest from 7.4.3 to 7.4.4 (#639)
  Disabled second PSU provider for VM tests
  System check providers running (#619)
  Stderr is now by default UTF-8 (#624)
  Refactored kill/killpg mechanism to be unified and actually fail on n… (#625)
  Command fix. Must be list append
  Refactorings
  Moved tinyproxy out of if clause
  Refactoring for error messages and security fix for path echoing (#636)
ArneTR added a commit that referenced this pull request Jan 2, 2024
* main:
  Dev mode (#637)
  Hotfix: resolutions -> resolution
  Adds skip_checks to providers (#566)
  Bump pytest from 7.4.3 to 7.4.4 (#639)
  Disabled second PSU provider for VM tests
  System check providers running (#619)
  Stderr is now by default UTF-8 (#624)
  Refactored kill/killpg mechanism to be unified and actually fail on n… (#625)
  Command fix. Must be list append
  Refactorings
  Moved tinyproxy out of if clause
  Refactoring for error messages and security fix for path echoing (#636)
  GMT color via own commit hash (#634)
  Hotfix for branch not main
  Non-Blocking starlette body read (#633)
  Bump fastapi from 0.105.0 to 0.108.0 (#632)
  Updated XGBoost submodule
  Bump pydantic from 2.5.2 to 2.5.3 (#628)
  Added stddev to timeline (#627)
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.

2 participants