Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-85883

Allow extending arbitrary types with partitioned counters

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Service Arch
    • Service Arch 2024-02-05, Service Arch 2024-02-19

      Create CounterHolder, a new type that holds a collection of partitioned counters:

      • A derived type (i.e. ServiceContext) must extend CounterHolder, highlighting that it can be augmented with partitioned counters.
      • Counters can then be added to the derived type using a new API, which is very similar to that used for declaring decorations.
      • For simplicity, all counters are the same type (64-bit unsigned integer) and are initialized at zero.
      • The declared counters will be partitioned based on the number of virtual cores, which is decided at runtime, and packed into as few cache-lines as possible.
      • Counters can be defined in any compilation unit, however, their lifetime is bound to the parent object (e.g. ServiceContext) and may be packed into the same cache-line with counters from other compilation units.

      Internally, CounterHolder uses Counter to manage individual counters (see SERVER-85877). Also, this is primarily designed for service-level counters (e.g. those on ServiceContext).

            Assignee:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: