Skip to content

Conversation

@msodi
Copy link
Contributor

@msodi msodi commented Jul 8, 2020

closes #257

}
}

func countFieldsRecursive(properties Properties, fieldCounter float64) float64 {
Copy link
Contributor

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.

Comment on lines +142 to +148
var imr IndicesMappingsResponse
err := im.getAndParseURL(&u, &imr)
if err != nil {
return imr, err
}

return imr, err
Copy link
Contributor

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 {
Copy link
Contributor

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.

@jnadler
Copy link
Contributor

jnadler commented Sep 3, 2020

@msodi are you still there? we need this as well, and i'd be willing to work on this PR if that helps

@msodi
Copy link
Contributor Author

msodi commented Sep 7, 2020

@msodi are you still there? we need this as well, and i'd be willing to work on this PR if that helps

I am still there but did not have the chance yet to continue working on this PR. Feel free to do so. Thanks @jnadler

@jnadler
Copy link
Contributor

jnadler commented Sep 10, 2020

Please close in favor of #386 and I'll try to push this over the finish line.

@msodi
Copy link
Contributor Author

msodi commented Sep 10, 2020

Thanks @jnadler for taking over

@msodi msodi closed this Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add gauge for total fields mapped in an index

3 participants