Skip to content

Update Entity to expose mergeAndReset method of internal object

MR adds a mergeAndReset(Entity) method to Monitoring::Hub::Entity to simplify the aggregation of Accumulators.

No protection is offered against use with incompatible entities. I discussed this with @sponce but we agreed that the additional overhead for the expected use case (essentially just the summing of two integers where compatibility is already guaranteed by the calling class) would be excessive. A comment was added to warn the users that they must ensure compatibility themselves before calling.

Merge request reports