-
Notifications
You must be signed in to change notification settings - Fork 7
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
Added energy consumption to Skyline #30
Conversation
michaelshin
commented
Jan 24, 2023
- Added energy measurement to Skyline
- Created new protobuf messages to send to the frontend
- Handled sending new message type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments. But looks great!
skyline/analysis/request_manager.py
Outdated
@@ -107,6 +107,23 @@ def _handle_analysis_request(self, analysis_request, context): | |||
context, | |||
) | |||
|
|||
# send energy response | |||
if not context.state.connected: | |||
logger.debug( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be an error instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes makes sense. I'll update the other conditions as well
resp = pm.EnergyResponse() | ||
try: | ||
energy_measurer.begin_measurement() | ||
iterations = 20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can declare this variable outside the try block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason that it should be outside the try block? I'm not sure I understand why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be easier to read if all the variables are declared at the beginning of the function. At least the ones that can be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The measurement part looks right to me.