Skip to content
Snippets Groups Projects

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Marco Clemencic mentioned in merge request !1257 (merged)

    mentioned in merge request !1257 (merged)

  • Marco Clemencic changed milestone to %v36r2

    changed milestone to %v36r2

  • added 1 commit

    • 0b362f5a - Add type check to Entity::mergeAndReset

    Compare with previous version

  • added 1 commit

    Compare with previous version

    • Resolved by Marco Clemencic

      Hi @clemenci unfortunately this doesn't work because in the vast majority of cases the Entity is created when MonitoringHub::registerEntity is called from the constructor of the base class BufferableCounter - so many incompatible Entity objects will share an identical typeindex. Additionally, the Entity created when a Counter is constructed will not match the typeindex of an Entity created from exactly the same Counter after the fact (when the derived class has finished being constructed).

  • Edited by Software for LHCb
  • mentioned in issue #207 (closed)

  • Marco Clemencic resolved all threads

    resolved all threads

  • Marco Clemencic approved this merge request

    approved this merge request

  • Marco Clemencic mentioned in commit db8604d1

    mentioned in commit db8604d1

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading