-
Notifications
You must be signed in to change notification settings - Fork 364
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
export Metrics in a cleaner struct #84
Conversation
This looks good. |
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.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @jarifibrahim, @karlmcguire, and @manishrjain)
cache.go, line 294 at r1 (raw file):
// Metrics returns statistics about cache performance. func (c *Cache) Metrics() *metrics {
There should be a way to only retrieve a specific metric instead of all the metrics every time.
From my PoV, and I suspect a lot of users of this, I'll be sticking a prom collector on the front of this and exposing all the metrics on every scrape. That seems like it would be the more common use case. |
I agree, and we can do that internally. But for the exported function, a "snapshot" with all the struct fields seems good enough. |
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.
Reviewed 5 of 6 files at r2.
Dismissed @manishrjain from a discussion.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @jarifibrahim)
cache.go, line 294 at r1 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
There should be a way to only retrieve a specific metric instead of all the metrics every time.
Done.
#59
This change is