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

koordlet: add GetNodeMetricSpec in statesInformer interface #2278

Conversation

j4ckstraw
Copy link
Contributor

@j4ckstraw j4ckstraw commented Nov 22, 2024

add func GetNodeMetricSpec, so we can get nodeMetricSpec conveniently by statesInformer interface

Ⅰ. Describe what this PR does

add GetNodeMetricSpec in statesInformer interface
prepare for #2273

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

V. Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in make test

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 66.06%. Comparing base (ceff9cd) to head (53221fd).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...kg/koordlet/statesinformer/impl/states_informer.go 50.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2278   +/-   ##
=======================================
  Coverage   66.06%   66.06%           
=======================================
  Files         454      454           
  Lines       53405    53413    +8     
=======================================
+ Hits        35281    35288    +7     
  Misses      15586    15586           
- Partials     2538     2539    +1     
Flag Coverage Δ
unittests 66.06% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@saintube saintube changed the title feat: add GetNodeMetric in statesInformer interface koordlet: add GetNodeMetric in statesInformer interface Nov 26, 2024
Copy link
Member

@saintube saintube left a comment

Choose a reason for hiding this comment

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

/lgtm

@saintube saintube added the lgtm label Nov 26, 2024
@saintube
Copy link
Member

@j4ckstraw BTW, in which cases does the state informer need to export the NodeMetric? As it is an aggregated result, we usually fetch the metric resource from the metric cache instead.

@j4ckstraw
Copy link
Contributor Author

@j4ckstraw BTW, in which cases does the state informer need to export the NodeMetric? As it is an aggregated result, we usually fetch the metric resource from the metric cache instead.

To support memoryCollectPolicy in #2273 (comment)

@saintube
Copy link
Member

saintube commented Nov 27, 2024

@j4ckstraw BTW, in which cases does the state informer need to export the NodeMetric? As it is an aggregated result, we usually fetch the metric resource from the metric cache instead.

To support memoryCollectPolicy in #2273 (comment)

@j4ckstraw This usage could be problematic. The metric advisor is the node metrics' data resource, so its collection should avoid depending on the node metrics due to circular reference. Perhaps, we can introduce the GetNodeMetricSpec to prevent misuse.

@j4ckstraw
Copy link
Contributor Author

@j4ckstraw BTW, in which cases does the state informer need to export the NodeMetric? As it is an aggregated result, we usually fetch the metric resource from the metric cache instead.

To support memoryCollectPolicy in #2273 (comment)

@j4ckstraw This usage could be problematic. The metric advisor is the node metrics' data resource, so its collection should avoid depending on the node metrics due to circular reference. Perhaps, we can introduce the GetNodeMetricSpec to prevent misuse.

OK, I'll change the pr.

@j4ckstraw j4ckstraw force-pushed the feat/add-getNodeMetric-in-statesInformer branch from c430447 to f4f0d66 Compare November 27, 2024 12:41
@j4ckstraw j4ckstraw changed the title koordlet: add GetNodeMetric in statesInformer interface koordlet: add GetNodeMetricSpec in statesInformer interface Nov 27, 2024
add func GetNodeMetricSpec, so we can get nodeMetricSpec conveniently by
statesInformer interface

Signed-off-by: j4ckstraw <[email protected]>
@j4ckstraw j4ckstraw force-pushed the feat/add-getNodeMetric-in-statesInformer branch from f4f0d66 to 53221fd Compare November 27, 2024 12:51
@j4ckstraw
Copy link
Contributor Author

PTAL @saintube

@koordinator-bot koordinator-bot bot merged commit 6fa0388 into koordinator-sh:main Nov 28, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants