As per the scope document, track the amount of time spent waiting on successful commits for each type of commit on mongos and add them to the "transactions" field in its serverStatus output.
This was spun off from SERVER-40984.
Proposed Implementation
- Add atomic int64_t field "successfulDurationMicros" to RouterTransactionMetrics::CommitStats
- When a transaction ends with TerminationCause::committed (i.e. successfully commits), add the transaction's commit duration to the atomic field
- Update RouterTransactionMetrics::updateStats() and add "successfulDurationMicros" long type to the CommitTypeStats IDL type (in router_transaction_stats.idl) to include successfulDurationMicros in serverStatus output
- Add unit / jstests
- Update existing jstests/noPassthrough/router_transaction_metrics.js and add new cases to transaction_router_test.cpp
- Some basic unit test cases: verify the field is incremented on successful commits, not on abort, not on unknown commit results, and that the field is cumulative across transactions
- is related to
-
SERVER-40984 Track and log relevant router-wide transaction metrics on mongos for serverStatus
- Closed