sarkaramrit1993 opened a new pull request, #5232: URL: https://github.com/apache/solr/pull/5232
[SOLR-11994](https://issues.apache.org/jira/browse/SOLR-11994) # Description First step of [SOLR-18571](https://issues.apache.org/jira/browse/SOLR-18571) (Query Insights). Adds a node-level hook that's notified when each top-level search finishes, so a module can track the slowest queries without parsing logs. Nothing changes unless a listener is registered. # Solution - `SearchRequestListener`, registered through `CoreContainer.addSearchRequestListener`, following `SolrCore.addConfListener`. - `SearchHandler.handleRequest` calls it on the coordinator after the search, with the request, `ResponseBuilder`, elapsed and CPU time, hits and any failure. Shard sub-requests, `/get` and `/export` aren't reported. - Why `SearchHandler`: `SolrCore.execute` runs for every handler, so it would have to filter out updates and admin calls. A last `SearchComponent` misses failed requests and needs solrconfig changes. The slow-query log only gives a text line above a threshold. - Listener exceptions are logged and don't affect the response. # Tests `SearchRequestListenerTest` on a 2-shard cluster covers: - one event per request, on the coordinator - the request fields - a failed search (400) - a throwing listener - `/get` and `/export` skipped - `shards.tolerant` - v2 `/select` - CPU time -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
