-
Notifications
You must be signed in to change notification settings - Fork 327
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(kuma-cp): Resource counter based on Mesh insights #1423
feat(kuma-cp): Resource counter based on Mesh insights #1423
Conversation
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Hey @jewertow! You're on the right track, don't hesitate to move the PR from draft. There is one moment that concerns me, |
@lobkovilya Yes, you're right that
Am I right that only mesh and zone are global-scoped resources? If it's true then this implementation should be correct, because this metric is not used to present number of meshes or zones. I am going to add a unit test and then I will change this draft to pull request. |
In addition to So I'd suggest having this code in a more generic manner: iterate over all types that we have and use method |
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
I added a test for resource counter. To make it possible I had to refactor existing code. I added new function |
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.
Overall looks great, thanks for your contribution! Just a small comment
pkg/metrics/store/counter.go
Outdated
return s.start(stop, ticker) | ||
} | ||
|
||
func (s *storeCounter) start(stop <-chan struct{}, ticker *time.Ticker) error { |
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 we can rename this to StartWithTicker
and call it from Start
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.
Done
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski jacek.ewertowski1@gmail.com
Issues resolved
Fix #1165
@jakubdyszkiewicz please check if it is what you expected?