-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
As part of porting opCounters over to OTel (SERVER-118979), we want to use an otel Counter type which can never go down (not even reset for testing). So this API needed to be removed. This wasn't too hard. This patch refactors test infrastructure to use isolated OpCounters instances instead of resetting global counters, which has the nice side effects of removing global variable references.
What changed?
- Removed `resetForTest()` method from `OpCounters` class that was used to reset global counters
- Modified `ClusterCommandTestFixture::testOpcountersAreCorrect()` to calculate counter deltas instead of comparing absolute values
- Added dependency injection to `QueryAnalysisSampler::QueryStats` to accept custom `OpCounters` instances via `setOpCountersForTest()`
- Updated test files to use isolated `OpCounters` instances rather than manipulating global state
- is depended on by
-
SERVER-118979 Tracking: query work for opcounters as OTel Metrics
-
- In Progress
-