Fix another race condition that causes lost metrics
This fixes another race condition that causes metrics to be lost when they are updated while the writer is stopped and after the monitorable has been re-added to the writer. In this case, the update needs to set the initial value on PcpValueInfo so that the correct value is written when the writer is started.
Additionally, while I was working on this, I noticed that if you have thousands of monitorables, then re-adding them in PcpMonitorBridge.startMonitoring() can take a very long time. For example, on one system I was seeing it take >20 seconds to add 40k monitorables. To help alleviate this problem, I added a cache to the metric name mapper and validator.
Resolves #132
@tallpsmith @natoscott
Any thoughts on a path forward here?
@pwinckles it conceptually makes sense to me - I'm guessing retired life is treating @tallpsmith very well and we wont hear from him, so please go ahead and merge when you are happy with your PRs (I don't have the java experience to give you deep and meaningful reviews).
@pwinckles it conceptually makes sense to me - I'm guessing retired life is treating @tallpsmith very well and we wont hear from him, so please go ahead and merge when you are happy with your PRs (I don't have the java experience to give you deep and meaningful reviews).
Currently a glorified kids Uber driver:
...and general house-wife. Not easy to find a chunk of time to sit and concentrate at the moment! :(