-
Type: Task
-
Resolution: Won't Do
-
Priority: 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).
- is related to
-
SERVER-85877 Use restartable sequences to implement a 64-bit counter
- Closed