We need a method that will log relevant information about a completed transaction. This will be used to log information about transactions that run too long, similar to how we currently log slow operations.Ultimately, we want to include the following stats:
- lsid, txnNumber, readConcern, autocommit
- OpDebug::AdditiveMetrics for the transaction
One approach would be to add a Session::reportTransaction method that logs this information in the appropriate format. It would have access to all the relevant transaction state already stored on the Session, including the SingleTransactionStats instance for that transaction, and its OpDebug::AdditiveMetrics object. To facilitate the logging of the stats from OpDebug::AdditiveMetrics object, we may also want to add an OpDebug::AdditiveMetrics::report method that generates a string showing the values all non-empty fields.