Skip to content
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

Merged
merged 3 commits into from
Jan 31, 2023
Merged

Conversation

michaelshin
Copy link
Contributor

  • Added energy measurement to Skyline
  • Created new protobuf messages to send to the frontend
  • Handled sending new message type

Copy link

@ssaini4 ssaini4 left a 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!

@@ -107,6 +107,23 @@ def _handle_analysis_request(self, analysis_request, context):
context,
)

# send energy response
if not context.state.connected:
logger.debug(
Copy link

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?

Copy link
Contributor Author

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
Copy link

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

Copy link
Contributor Author

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

Copy link

@ssaini4 ssaini4 Jan 26, 2023

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

Copy link
Contributor

@jimgao1 jimgao1 left a 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.

@michaelshin michaelshin merged commit 0cb0647 into main Jan 31, 2023
@michaelshin michaelshin deleted the add-energy-profiling branch April 27, 2023 19:54
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.

None yet

3 participants