parfait icon indicating copy to clipboard operation
parfait copied to clipboard

Fix another race condition that causes lost metrics

Open pwinckles opened this issue 10 months ago • 3 comments

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

pwinckles avatar Feb 21 '25 16:02 pwinckles

@tallpsmith @natoscott

Any thoughts on a path forward here?

pwinckles avatar Jun 19 '25 00:06 pwinckles

@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).

natoscott avatar Jun 19 '25 04:06 natoscott

@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! :(

tallpsmith avatar Jun 24 '25 23:06 tallpsmith