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

export Metrics in a cleaner struct #84

Merged
merged 6 commits into from
Oct 25, 2019
Merged

export Metrics in a cleaner struct #84

merged 6 commits into from
Oct 25, 2019

Conversation

karlmcguire
Copy link
Contributor

@karlmcguire karlmcguire commented Oct 2, 2019

#59


This change is Reviewable

@tcolgate
Copy link

tcolgate commented Oct 2, 2019

This looks good.

Copy link
Contributor

@manishrjain manishrjain left a 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.

@tcolgate
Copy link

tcolgate commented Oct 2, 2019

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.

@karlmcguire
Copy link
Contributor Author

There should be a way to only retrieve a specific metric instead of all the metrics every time.

I agree, and we can do that internally. But for the exported function, a "snapshot" with all the struct fields seems good enough.

This was referenced Oct 2, 2019
Copy link
Contributor Author

@karlmcguire karlmcguire left a 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: :shipit: 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.

@karlmcguire karlmcguire merged commit 6372b1d into master Oct 25, 2019
@karlmcguire karlmcguire deleted the karl/metrics branch October 25, 2019 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants