[SERVER-73806] Avoid implicit conversion to long long in Counter64 and Atomic64Metric classes Created: 09/Feb/23  Updated: 07/Feb/24

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Adi Zaimi Assignee: Billy Donahue
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-82303 Support for multiple MetricTree In Code Review
Assigned Teams:
Service Arch
Sprint: Service Arch 2024-02-19
Participants:

 Description   

Counter64 and Atomic64Metric have an implicit conversion to long long which is risky. It may be preferred to have a more conventional extension mechanism for custom metrics specifically.

With the way they are currently defined we can place Counter64 and Atomic64Metric in any BSON object and they're also usable in any function that accepts a long long, which feels very loose and not quite what we intend to allow by making these definitions.

This came up while reviewing PR 9902 (of SERVER-72815).



 Comments   
Comment by Billy Donahue [ 07/Feb/24 ]

Bringing this into SERVER-82303, which introduces traits that make the conversion unnecessary.

Generated at Thu Feb 08 06:25:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.