[SERVER-70492] Enable verbose command line argument for benchmarks Created: 12/Oct/22  Updated: 29/Oct/23  Resolved: 22/Nov/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Ivan Fefer Assignee: Trevor Guidry
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

unittest_main has verbose flag to control log level: https://github.com/mongodb/mongo/blob/master/src/mongo/unittest/unittest_main.cpp#L122
It would be great to have the same for benchmarks: https://github.com/mongodb/mongo/blob/master/src/mongo/unittest/benchmark_main.cpp#L43

It can be useful to be able to change log level without re-compiling code when adding or debugging benchmarks.



 Comments   
Comment by Githook User [ 22/Nov/22 ]

Author:

{'name': 'Trevor Guidry', 'email': 'trevor.guidry@mongodb.com'}

Message: SERVER-70492 Enable verbose command line argument for benchmarks
Branch: master
https://github.com/mongodb/mongo/commit/57ee472660e709c78fa705f43a86853cf61f1d16

Comment by Andrew Morrow (Inactive) [ 21/Oct/22 ]

This is a reasonable request but will require a little more effort to introduce: we can't simply copy what the unit test setup does. In the case of the unit tests, all of the command line arguments are "ours", but in the case of the benchmark setup, several of the options are actually meaningful to the benchmark framework. Effectively, the current benchmark mainline doesn't need to know the difference or worry about overlap, since it just forwards everything to the benchmark side. If we want to start honoring additional mongodb specific flags, we will need to filter them out and act on them before invoking benchmark with a sanitized argv/argc. It does appear that all of the interesting flags that benchmark takes start with --benchmark_ (with the notable exception of --v). That may make filtering easier, if we just assume that 1) any flag starting with --benchmark_ should be tunneled to benchmark and no other, and that 2) all remaining flags are ours. Maybe something smart can be done with verbosity. In any event, this seems overall achievable with some thought and a bit of logic in the mainline.

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