-
Notifications
You must be signed in to change notification settings - Fork 807
#257: Add gauge for total fields mapped in an index #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
Conversation
| } | ||
| } | ||
|
|
||
| func countFieldsRecursive(properties Properties, fieldCounter float64) float64 { |
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.
This probably makes sense as a pointer to reduce the number of memory allocations for each recursion depth. That would also mean that there is no return necessary.
| var imr IndicesMappingsResponse | ||
| err := im.getAndParseURL(&u, &imr) | ||
| if err != nil { | ||
| return imr, err | ||
| } | ||
|
|
||
| return imr, err |
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.
Since the return is the same if err is or is not nil, this could be simplified to just return im.getAndParseURL(). That would also mean that imr would not need to be defined here and could be defined iin getAndParseURL
| } | ||
|
|
||
| // Mappings defines all index mappings | ||
| type Mappings struct { |
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 the names Mappings, Properties, Fields, Property, and Field are really generic and could cause naming collisions in the future. It probably makes sense to use more specific names like IndexMappings, IndexMappingField, etc.
|
@msodi are you still there? we need this as well, and i'd be willing to work on this PR if that helps |
|
Please close in favor of #386 and I'll try to push this over the finish line. |
|
Thanks @jnadler for taking over |
closes #257