[SERVER-70996] Add serverStatus reporting for query analysis Created: 01/Nov/22 Updated: 29/Oct/23 Resolved: 09/Mar/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Cheahuychou Mao | Assignee: | Israel Hsu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Sharding NYC
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | Sharding NYC 2023-02-06, Sharding NYC 2023-02-20, Sharding NYC 2023-03-06 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 145 | ||||||||||||
| Description |
|
From the design: The serverStatus command response on mongos and mongod will include a “queryAnalyzers” section with the following diagnostics:
|
| Comments |
| Comment by Githook User [ 09/Mar/23 ] |
|
Author: {'name': 'Israel Hsu', 'email': 'israel.hsu@mongodb.com', 'username': 'israelhsu'}Message: |
| Comment by Israel Hsu [ 22/Feb/23 ] |
|
As per discussion with Chou last week:
|
| Comment by Israel Hsu [ 15/Feb/23 ] |
|
cheahuychou.mao@mongodb.com This is my current thinking on this server-wide counting: Rename the existing SampleCounters to CollectionSampleCounters. I'd like to avoid having the calling code have to invoke an increment() function for both a collection-level counter and a server-level counter. I propose having a new object called SampleCounters that maintains both server-level and collection-level counters; it contains a map of the CollectionSampleCounters indexed by collection UUID. The new SampleCounters would contain all the logic to generate serverStatus section and the $currentOp reports. CollectionSampleCounters would be abstracted away from the POV of QueryAnalysisWriter and QueryAnalysisSampler. Both QueryAnalysisSampler and QueryAnalysisWriter would have an instance of the new SampleCounters. When they need to count, they invoke SampleCounters::incrementRead(ns, collUuid, size) where size is boost::optional. Thoughts? |