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

feat(metrics): refactor idle power exposure #1810

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

rootfs
Copy link
Contributor

@rootfs rootfs commented Oct 16, 2024

As discussed in the Oct 15 meeting, we make the idle power classification optional, until we have an idle power regression model that can predict idle power by system utilization.

Copy link
Contributor

github-actions bot commented Oct 16, 2024

🤖 SeineSailor

Here is a concise summary of the pull request changes:

Summary: The feat(metrics): refactor idle power exposure pull request makes idle power classification optional until an idle power regression model is available. Key modifications include:

  • Refactoring newAppConfig and main functions in exporter.go
  • Updating UpdateNodeEnergyMetrics function in node_energy_collector.go
  • Modifying calcDynEnergy function in stats.go

Impact: These changes do not affect the external interface or behavior of the code. However, it's essential to ensure that the optional idle power classification does not introduce any performance or accuracy issues. Additionally, it would be beneficial to include tests to verify the correctness of the refactored code.

Copy link
Collaborator

@KaiyiLiu1234 KaiyiLiu1234 left a comment

Choose a reason for hiding this comment

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

@rootfs Code lgtm. So this ensures idle Energy is always 0 now? Dynpower will be reflective of the total energy? This means if I validate kepler's energy metrics with node exporter, they should be essentially identical.

@@ -174,7 +174,7 @@ func (s *Stats) CalcDynEnergy(absM, idleM, dynM, id string) {

// calcDynEnergy calculates the dynamic energy.
func calcDynEnergy(totalE, idleE uint64) uint64 {
if (totalE == 0) || (idleE == 0) || (totalE < idleE) {
if (totalE == 0) || (totalE < idleE) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should fix this bit as well ..
If the totalE < the idle, then we have a new idle, IOW kepler over time will continue to improve its accuracy of idle by measuring the least amount of power consumed by the system.

Copy link
Collaborator

@sunya-ch sunya-ch Oct 17, 2024

Choose a reason for hiding this comment

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

Agree but I think should note and fix this in the different issue and PR.
The logic seems to be around this line: https://github.com/rootfs/kepler/blob/20385219b8230fad9c6d1c792b57cde4c1419292/pkg/collector/stats/node_stats.go#L72

I think we may start from do not set idle power to any value if resource usage is more than some threshold.

Copy link
Collaborator

@sunya-ch sunya-ch left a comment

Choose a reason for hiding this comment

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

/lgtm thank you!

Copy link
Collaborator

@sthaha sthaha 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 currently testing this patch 🤞

@sthaha sthaha merged commit 3c5beae into sustainable-computing-io:main Oct 17, 2024
23 checks passed
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.

4 participants