Skip to content

New metric boxes #1279

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

New metric boxes #1279

wants to merge 7 commits into from

Conversation

ribalba
Copy link
Member

@ribalba ribalba commented Aug 7, 2025

This is the first version that is not totally complete. Needs testing on machines with more metrics providers enabled. Also I am sure @ArneTR will want some changes :)

image

@ribalba ribalba requested a review from ArneTR August 7, 2025 11:11
@ArneTR
Copy link
Member

ArneTR commented Aug 7, 2025

I will fix the failing test in review

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.

Looks awesome!

Added my review comments. Currently experiencing an error. Otherwise looks good

@ArneTR
Copy link
Member

ArneTR commented Aug 8, 2025

Also one more request: It would be nice if the color line at the bottom of the boxes of the boxes changes when tabbing power -> energy -> co2.
The color I imagine are orange -> blue -> black.

Copy link

github-actions bot commented Aug 8, 2025

There is a problem with the Gemini CLI PR review. Please check the action logs for details.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

📋 Review Summary

This pull request introduces a new design for the metric boxes on the frontend, making them more dynamic and organized with tabs for Power, Energy, and CO2. The backend is updated to calculate network power.

🔍 General Feedback

  • The new metric box implementation in frontend/js/helpers/metric-boxes.js is a great improvement in terms of modularity and maintainability.
  • There is a critical bug in the new implementation where the metrics are not updated correctly for each phase.
  • There are some minor issues with naming conventions and code cleanliness that should be addressed.

@ArneTR
Copy link
Member

ArneTR commented Aug 8, 2025

@gemini-cli /review

@ArneTR
Copy link
Member

ArneTR commented Aug 8, 2025

@gemini-cli /review

@davidkopp @ribalba This should now trigger gemini PR reviews. Please try it out next time you make a PR. It should also work automatically on new PRs ... untested though.

Currently Google seems overloaded ... so double check the actions if nothing happens (Failed example due to overload: https://github.com/green-coding-solutions/green-metrics-tool/actions/runs/16824036563)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

📋 Review Summary

This pull request introduces a new design for the metric boxes in the frontend, moving from a static layout to a more dynamic and organized tabbed view for power, energy, and CO2 metrics. The changes also include updates to the backend to calculate and provide the necessary data for these new metrics.

🔍 General Feedback

  • The new metric boxes are a great improvement, providing a much cleaner and more organized way to display the data.
  • The use of WebComponents is a good choice for creating reusable UI elements.
  • The code is generally well-written and easy to follow.
  • There are a few instances where let is used when const would be more appropriate.
  • Some functions can be simplified by using a single return statement.

Comment on lines 68 to 70

const machine_power_metric_condition = (metric) => {
if(metric.match(/^.*_power_.*_machine$/) !== null) return true;
Copy link

Choose a reason for hiding this comment

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

low: It's better to use a single return statement.

Suggested change
const machine_power_metric_condition = (metric) => {
if(metric.match(/^.*_power_.*_machine$/) !== null) return true;
return metric.match(/^.*_power_.*_machine$/) !== null;

@ArneTR
Copy link
Member

ArneTR commented Aug 8, 2025

Speaking of overhead: The current Google recommendation implemntation does the following:

  • Install a watcher for new issues
    - Run a GitHub Actions run (aka spin up a whole VM) for every new comment.
    - Install 436 (sic!) npm packages incl. the Gemini CLI
    - Make a string comparison if the comment contains (gemini) and if so parse the command. Otherwise shut down

So just so you know: Every 100 character comment has now the power of using the same amount of compute you needed to fully complete Doom 1 in 1980 (unverified estimate :) )

Edit: my analysis was wrong. The skipping code is actually used by the orchestrator before the VM gets spun up. Phew ... :) Less work for me

Still: Will keep the solution in for a couple of days. Then alter it.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

📋 Review Summary

This pull request introduces a new design for the metric boxes in the frontend, using tabs to separate Power, Energy, and CO2 metrics. The backend is updated to calculate network power. The new UI is a good improvement, but there are a few minor issues to address.

🔍 General Feedback

  • The new tabbed interface for metrics is a great enhancement for organizing and visualizing the data.
  • The code is well-structured, but there are some leftover artifacts from the refactoring, like commented-out code and console logs, that should be cleaned up.
  • There's a small regression in the UI where the metric type information (e.g., AVG + STD.DEV) is no longer displayed.

@ribalba
Copy link
Member Author

ribalba commented Aug 11, 2025

@ArneTR put in all the stuff we talked about. The only thing I didn't come up with a nice way of doing is changing the name to "GPU Power" if there is no power reading for GPU. If this is important let me know and I will write a little for loop that does this at the end. Seemed "unclean" though.

Also I couldn't test with RAM, GPU and Disk readings. Maybe we should add this to the example data?

ArneTR added 2 commits August 12, 2025 07:47
* main:
  Bump actions/create-github-app-token in /.github/workflows (#1284)
  Bump pylint from 3.3.7 to 3.3.8 (#1285)
  Updated echarts vor v.6.0 (#1282)
  Bump python from 3.13.5-slim-bookworm to 3.13.6-slim-bookworm in /docker (#1286)
  Bump deepdiff from 8.5.0 to 8.6.0 (#1283)
  Log parsing on full data (#1276)
  Bump redis from 6.3.0 to 6.4.0 (#1281)
  Added Gemini PR Review
  measurement_flow_process_duration is set in any case. Supplying a timeout of None will lead to no timeout
  Detect systemd cgroup path using cgroup name (instead of container id) (#1270)
  Bump redis from 6.2.0 to 6.3.0 (#1275)
  Removing sampling_rate for XGboost also from codespaces
  lsmod now uses sort
  Added kernel modules to listing
  (fix): Warnings error should not show on HTTP 204 - case is expected
  Fix NetworkIoCgroupSystemProvider doesn't create a value column (#1274)
  Clarifying comment for design decision
  Document the usage of cgroup system metric providers (#1273)
  Suspend check (#1269)
@ArneTR
Copy link
Member

ArneTR commented Aug 12, 2025

I merged in the branch and applied the suggestion to rename network_io_power_w => network_io_power_in_mW.

What is also left unresolved, but was maybe a particular decision, is that the information of "Diff in %" and "AVG+STD.DEV" is not displayed anymore.

I think it is quite clear what the values mean ... but open for discussion on this.

What also is gone is the info from which source the metric originates. I personally always liked to quickly tell if it is an MCP value or an XGBoost value. Have you, @ribalba / @davidkopp ever used it though?
Also open to discussions on this wether to fully remove or not. Or we can also make it optional to only display it in an "expert mode".

Screenshots to make it clear:
Screenshot 2025-08-12 at 7 53 46 AM
Screenshot 2025-08-12 at 7 53 14 AM
Screenshot 2025-08-12 at 7 53 09 AM
Screenshot 2025-08-12 at 7 52 07 AM

@davidkopp
Copy link
Collaborator

Regarding the question, if I ever used the source information (MCP / XGBoost): Yes, I also liked to see that. Would be nice if there would be still a way to display it. At least the information is still part of the tooltip.

The removal of "Diff in %" and "AVG+STD.DEV" would be ok for me. As you already said it is quite clear what the values mean. Maybe the information could be added to the tooltip (is not the case yet).

Here some more feedback...

The value in the tooltip of the embodied carbon metric does not match the displayed value:
image

The link in the tooltip of the network metric is not helpful. It is not clickable and you can't copy it:
image

I think the information "through a syscall" can be removed (or why is this relevant?):
image

In the comparison view the tooltip does not work:
image

@ArneTR
Copy link
Member

ArneTR commented Aug 12, 2025

I have made some suggestions on how to display the source (MCP here only used as example). Top row seems the easiest with CSS.
Bottom row has the issue that the box width does not expand and it collapses into two lines which are a bit off in terms of height.
Screenshot 2025-08-12 at 10 06 01 AM
Screenshot 2025-08-12 at 10 05 46 AM
Screenshot 2025-08-12 at 10 04 32 AM
Screenshot 2025-08-12 at 10 04 21 AM
Screenshot 2025-08-12 at 10 04 14 AM
Screenshot 2025-08-12 at 10 04 02 AM
Screenshot 2025-08-12 at 10 03 32 AM
Screenshot 2025-08-12 at 10 03 26 AM

@ArneTR
Copy link
Member

ArneTR commented Aug 12, 2025

Here a couple of more ideas with moving the unit down to the number and putting the source in a label in the top right
Screenshot 2025-08-12 at 10 16 35 AM
Screenshot 2025-08-12 at 10 16 56 AM
Screenshot 2025-08-12 at 10 17 02 AM

@ArneTR
Copy link
Member

ArneTR commented Aug 12, 2025

Reply to @davidkopp comment:

  • The tooltip showing 7616 ug for a rounded value of 0.01 g is correct. Tooltips show the unrounded value.
  • Link in tooltip is not optimal, agreed. There is no way to make it clickable sadly and I opted for still having this somehow displayed. Would leave it for now.
  • Syscall is the source of the value for the time, which distinguishes it from an actual measurement from an external clock. Can be made more clear which syscall it is and what the underlying clock source is, but I deem it as more helpful than leaving it out.
  • the null[null] is definitely a bug. Preferred behaviour is that the diff shows as unrounded value with no dimension (just %). Existed also in current main though ... made this an issue.

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.

3 participants