-
Notifications
You must be signed in to change notification settings - Fork 450
PMM-14431 More complex check if it is real count type or not. #1195
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
base: main
Are you sure you want to change the base?
Conversation
d56ff3c to
c9afe29
Compare
| return res | ||
| } | ||
|
|
||
| func handleMetricSwitch(reservedNames []string, prefix, nextPrefix, k string, val interface{}, l map[string]string, compatibleMode bool) []prometheus.Metric { |
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.
🚫 [golangci-lint] reported by reviewdog 🐶
calculated cyclomatic complexity for function handleMetricSwitch is 12, max is 10 (cyclop)
ademidoff
left a comment
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'm seeing GetAllIndexesForCollections being called in multiple collectors. This call is rather expensive. Would it be beneficial to cache it for a short period of time?
exporter/metrics.go
Outdated
| if err != nil { | ||
| continue // skip collections where indexes cannot be listed (e.g., views, system collections) | ||
| } | ||
| defer cursor.Close(ctx) //nolint:errcheck |
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 don't think this would be the best to run defer in a loop within this context. Can we declare the cursor variable outside of the loop and defer once?
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.
Good point. Moved to the end since there are multiple cursors.
PMM-14431
FB: Percona-Lab/pmm-submodules#4118