For both mongos and mongod, it would be helpful to have an indicator of how long server discovery is taking.
For example, if a replica set has an election, understanding the time it took a mongos to discover the new primary is very useful to diagnose issues, by logging "It took X milliseconds to find a valid primary" This should measure the time from when a active primary is not detected until a new primary is discovered.
Ideally, a single log line reports
- the total time, as .attr.durationMillis, that any server needed to determine the state of another server
- the desired state that needs to be determined or the reason the state of the other server needed to be known
server description record in topology change message includes the amount of time spent in previous topology state.