-
Notifications
You must be signed in to change notification settings - Fork 670
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
SOLR-17340: add cache on top of BeanInfo instrospector #2538
Conversation
MetricUtils.addMXBeanMetrics(obj, intf, null, consumer); | ||
MetricUtils.addMXBeanMetrics(obj, intf, prefix, consumer); |
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.
What's this about here; seems like metrics would be published in a different spot, right?
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 forgot to comment on this when creating the pull request.
I think this was a typo when this code was initially added. The prefix
parameter of the method is not passed through to the other method. In practice, all callers to addMXBeanMetrics()
in Solr code set null for this parameter, so this will not change anything.
Another option could be to just remove the parameter, but I think it's better to keep it if we have later more categories for metrics.
@@ -152,6 +152,8 @@ Optimizations | |||
|
|||
* SOLR-17349: SolrDocumentFetcher should always skip lazy field loading overhead if documentCache==null (Michael Gibney) | |||
|
|||
* JIRA-17340: Add cache on top of system metrics BeanInfos to make call to /admin/info/system faster (Pierre Salagnac) |
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.
* JIRA-17340: Add cache on top of system metrics BeanInfos to make call to /admin/info/system faster (Pierre Salagnac) | |
* SOLR-17340: Add cache on top of system metrics BeanInfos to make call to /admin/info/system faster (Pierre Salagnac) |
Note the prefix arg was always null, thus this one-line change is just a refactoring for correctness. (cherry picked from commit 0da7a78)
https://issues.apache.org/jira/browse/SOLR-17340
Description
Solr endpoint
/solr/admin/info/system
is slow because of time spent in Java beans introspection.Solution
Add a simple cache on top of bean info introspection. For each bean class, the introspection will be run only once for the JVM lifespan.
Tests
Naive performance benchmark. See results in Jira comment
Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.