I'm a little confused by the title - isn't this simply exposing hdfds block cache metrics via JMX? Why anything specific about allocate/lost? I see all sorts of stats in the getStatistics call.
The buffer allocatione/lost metrics are currently not exposed at all. When moving everything from metricsRecord.setMetric to stats.add in the metrics method, these lines are completely new, instead of being converted over.
+ stats.add("buffercache.allocations", getPerSecond(shardBuffercacheAllocate.getAndSet(0), seconds));
+ stats.add("buffercache.lost", getPerSecond(shardBuffercacheLost.getAndSet(0), seconds));
We also probably want to try and align some of the stat key names with other cache objects in Solr: the query cache, filter cache, etc.
This makes sense, I'll look into it.
Also, I don't believe these will get registered with the jmx server. I think only the top level class for a plugin is by default - eg the HdfsDirectoryFactory itself.
Not sure I understand this. Where should I look to make sure this is getting registered?