diff options
author | Nathan Louie <nathan.louie@10gen.com> | 2018-06-11 15:25:05 -0400 |
---|---|---|
committer | Nathan Louie <nathan.louie@10gen.com> | 2018-06-18 17:17:35 -0400 |
commit | 2a81c6190985975913fe75dace4fd157b8e82590 (patch) | |
tree | 14cc55da81e9ab4360c8e9b6405ceae6ee62b06d /src/mongo/db/server_transactions_metrics.cpp | |
parent | 013b82bf5f58bd7de8ae2f4d28d24f82afa22e64 (diff) | |
download | mongo-2a81c6190985975913fe75dace4fd157b8e82590.tar.gz |
SERVER-35149 Track total number of open transactions in ServerTransactionsMetrics
Diffstat (limited to 'src/mongo/db/server_transactions_metrics.cpp')
-rw-r--r-- | src/mongo/db/server_transactions_metrics.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/server_transactions_metrics.cpp b/src/mongo/db/server_transactions_metrics.cpp index fe31687f288..07319300f74 100644 --- a/src/mongo/db/server_transactions_metrics.cpp +++ b/src/mongo/db/server_transactions_metrics.cpp @@ -51,6 +51,18 @@ ServerTransactionsMetrics* ServerTransactionsMetrics::get(OperationContext* opCt return get(opCtx->getServiceContext()); } +unsigned long long ServerTransactionsMetrics::getCurrentOpen() const { + return _currentOpen.load(); +} + +void ServerTransactionsMetrics::decrementCurrentOpen() { + _currentOpen.fetchAndSubtract(1); +} + +void ServerTransactionsMetrics::incrementCurrentOpen() { + _currentOpen.fetchAndAdd(1); +} + unsigned long long ServerTransactionsMetrics::getTotalStarted() const { return _totalStarted.load(); } |