To store server-wide metrics on multi-document transactions, we need a class that will store these metrics and an instance of it that is globally accessible. We will follow the same pattern used by the RetryableWritesStats class. We will create a ServerTransactionsMetrics class and add it as a decoration on the ServiceContext. This class should initially be just a skeleton, until we add member variables to track various metrics. We should also include a dummy void ServerTransactionsMetrics::updateStats(TransactionsStats* stats) method, that mirrors the method of RetryableWritesStats. Once we start to track metrics in this class, the updateStats method will allow us to copy the stored metrics into a serializable TransactionStats object, suitable for output in serverStatus.
As a part of this ticket, we can call ServerTransactionsMetrics::updateStats from within TransactionsSSS::generateSection, even though it will initially do nothing.