tflobbe / solrmeter

Stress test tool for Apache Solr
70 stars 37 forks source link

Add Cache Statistics support for multiple collections in Solr. #128

Closed mattshunter closed 6 years ago

mattshunter commented 6 years ago

This change applies to the Cache History Panel. It allows viewing cache statistics for each collection in a Solr instance. Currently, the feature can only be enabled by importing a configuration from a file.

To enable this feature, define a variable called solr.collection.names in the configuration file, entering the names of the collections in your Solr instance. In the Cache History Panel, a combo box in the top left of the panel will appear with the list of collections populated. Switching between each of the collections will update the associated cache statistics relevant to the collection.

image

janhoy commented 6 years ago

Does this work for Solr6.x and 7.x? In v0.3.0 i cannot get the cache panel to work at all..

mattshunter commented 6 years ago

I haven't tested with Solr 7, but I've tested with Solr 5.x and Solr 6.x, running in both standalone and cloud modes. I assume it would run fine on 7, but I haven't tested it yet.

Do you have a configuration with multiple collections in Solr? That was why I created the pull request The cache panel isn't functional in 0.3.0 with multiple collections because caching is distinct to each collection (and the cache panel was attempting to read cache statistics at a location that wouldn't exist under that condition).

janhoy commented 6 years ago

Ah, I see, so this PR also fixes the cache stats in general, which will lead to a 0.4 release, is that the plan?

Can I suggest that you get the list of collections from the Collections API instead of a static variable? https://lucene.apache.org/solr/guide/6_6/collections-api.html#CollectionsAPI-list

Perhaps @tflobbe is open to promoting @mattshunter and myself to project committers, and I'll help getting the release done :)

mattshunter commented 6 years ago

If we used the Collections API, would we sever backwards compatibility with older Solr releases? The current SolrJ dependency in the build is 3.6.1, so it's getting a little dusty. :)

I know it would work with Solr 5 since I'm using that API in other work. It would make things less configuration dependent for sure.

tflobbe commented 6 years ago

Thanks for the PR @mattshunter, and sorry for the late response. I’m on vacations and I don’t have my computer with me. I’ll take a look as soon as I get back.

tflobbe commented 6 years ago

Thanks for working on this @mattshunter, and sorry for the delay. @janhoy, just invited you as collaborator on the project. @mattshunter, I can also add you if you plan to do any more work

mattshunter commented 6 years ago

Sure! I’ve been working through @janhoy ‘s suggestion on using the Collections API and I’ve made some headway, but it’s not quite ready for use yet. Updating to the newer SolrJ library has presented a few challenges.

Thanks for the merge @tflobbe! I hope a few folks in the community will get some use out of it.

janhoy commented 6 years ago

“The reports of my death are greatly exaggerated.” -SolrMeter :)