[SERVER-67102] Avoid unnecessary string copies in Resource Consumption metrics Created: 08/Jun/22  Updated: 29/Oct/23  Resolved: 07/Jul/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0, 6.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Jordi Olivares Provencio Assignee: Jordi Olivares Provencio
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File string-data-patch.patch    
Issue Links:
Related
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2022-07-11
Participants:
Linked BF Score: 100

 Description   

It seems that the api to increment metrics requires a full string value even though the string is only used for debug logging

This leads to callers needing to construct temporary strings that will allocate and deallocate from the heap immediately afterwards.

Ideally this should be replaced by a StringData object to avoid memory allocations plus copying.



 Comments   
Comment by Githook User [ 29/Aug/22 ]

Author:

{'name': 'Alberto Massari', 'email': 'alberto.massari@mongodb.com', 'username': 'albymassari'}

Message: SERVER-67102 Complete the removal of unnecessary string copies in MetricsCollector
Branch: master
https://github.com/mongodb/mongo/commit/440849b9ebe471ddf4103185c261813dd01f1a01

Comment by Githook User [ 07/Jul/22 ]

Author:

{'name': 'Jordi Olivares Provencio', 'email': 'jordi.olivares-provencio@mongodb.com', 'username': 'jordiolivares'}

Message: SERVER-67102 Avoid unnecessary string copies for metrics
Branch: master
https://github.com/mongodb/mongo/commit/0f8bfc630081c7688bbc8072c4380d854f0e1c58

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