Metrics

There’s basic metrics support for request timings and number of exceptions. You can provide your own implementation of io.ino.solrs.Metrics or use the CodaHaleMetrics class shipped with solrs if you’re just happy with this metrics library :-)

To configure solrs with the Metrics implementation pass an initialized instance like this:

sourceval solr = AsyncSolrClient.Builder("http://localhost:8983/solr/collection1")
  .withMetrics(new CodaHaleMetrics())
  .build

If you’re using Coda Hale’s Metrics library and you want to reuse an existing MetricsRegistry, just pass it to the CodaHaleMetrics class: new CodaHaleMetrics(registry).

The source code for this page can be found here.