Skip to content

Use actual counter type when registering to monitoring

Marco Clemencic requested to merge fix-counter-self-register into master

Having the counters delegate to BufferableCounter constructor for self registration to monitoring was hiding the actual type of counter to Entity so part of the customizations were lost (in particular the merge from JSON).

This MR changes BufferableCounter constructor signature to allow propagation of the final counter type to the Entity constructor. It also extends the unit tests to expose the problem (and validates the fix) of Counter not being recognized as mergeable from JSON.

The drawback is that specializations of BufferableCounter must have a typeString static data member.

Making the self registration constructor protected also prevents issues like that fixed in lhcb/LHCb!3830 (merged).

/cc @sponce

Merge request reports