jstests/concurrency/fsm_workload_helpers/check_transaction_server_status_invariants.js
/**
 * Certain metrics for non-prepared transactions can be calculated by subtracting the relevant
 * total transactions metric by the relevant prepared transactions metric.
 * serverStatus invariant: unpreparedAborted + unpreparedCommitted + unpreparedOpen =
 * totalUnprepared
 */
Certain metrics for non-prepared transactions can be calculated by subtracting the relevant
total transactions metric by the relevant prepared transactions metric.
serverStatus invariant: unpreparedAborted + unpreparedCommitted + unpreparedOpen
totalUnprepared
Certain metrics for non - prepared transactions can be calculated by subtracting the relevant total transactions metric by the relevant prepared transactions metric . serverStatus invariant : unpreparedAborted + unpreparedCommitted + unpreparedOpen totalUnprepared
function unpreparedAbortedPlusUnpreparedCommittedPlusUnpreparedOpenEqualsTotalUnprepared(
    serverStatusTxnStats) {
    let unpreparedAborted = Number(serverStatusTxnStats["totalAborted"]) -
        Number(serverStatusTxnStats["totalPreparedThenAborted"]);
    let unpreparedCommitted = Number(serverStatusTxnStats["totalCommitted"]) -
        Number(serverStatusTxnStats["totalPreparedThenCommitted"]);
    let unpreparedOpen = Number(serverStatusTxnStats["currentOpen"]) -
        Number(serverStatusTxnStats["currentPrepared"]);
    let totalUnprepared = Number(serverStatusTxnStats["totalStarted"]) -
        Number(serverStatusTxnStats["totalPrepared"]);
    return (unpreparedAborted + unpreparedCommitted + unpreparedOpen) === totalUnprepared;
}
function unpreparedAbortedPlusUnpreparedCommittedPlusUnpreparedOpenEqualsTotalUnprepared ( serverStatusTxnStats ) { let unpreparedAborted = Number ( serverStatusTxnStats [ "totalAborted" ] ) - Number ( serverStatusTxnStats [ "totalPreparedThenAborted" ] ) ; let unpreparedCommitted = Number ( serverStatusTxnStats [ "totalCommitted" ] ) - Number ( serverStatusTxnStats [ "totalPreparedThenCommitted" ] ) ; let unpreparedOpen = Number ( serverStatusTxnStats [ "currentOpen" ] ) - Number ( serverStatusTxnStats [ "currentPrepared" ] ) ; let totalUnprepared = Number ( serverStatusTxnStats [ "totalStarted" ] ) - Number ( serverStatusTxnStats [ "totalPrepared" ] ) ; return ( unpreparedAborted + unpreparedCommitted + unpreparedOpen ) === totalUnprepared ; }
Certain metrics for non-prepared transactions can be calculated by subtracting the relevant
 total transactions metric by the relevant prepared transactions metric.
Certain metrics for non - prepared transactions can be calculated by subtracting the relevant total transactions metric by the relevant prepared transactions metric .