diff options
author | Maria van Keulen <maria@mongodb.com> | 2017-03-07 12:00:08 -0500 |
---|---|---|
committer | Maria van Keulen <maria@mongodb.com> | 2017-03-07 12:00:08 -0500 |
commit | 589a5c169ced8f6e9ddcd3d182ae1b75db6b7d79 (patch) | |
tree | c7a090ffdd56a91ae677e2492c61b820af44f964 /src/mongo/db/stats/storage_stats.cpp | |
parent | 3cba97198638df3750e3b455e2ad57af7ee536ae (diff) | |
download | mongo-589a5c169ced8f6e9ddcd3d182ae1b75db6b7d79.tar.gz |
SERVER-27938 Rename all OperationContext variables to opCtx
This commit is an automated rename of all whole word instances of txn,
_txn, and txnPtr to opCtx, _opCtx, and opCtxPtr, respectively in all
.cpp and .h files in src/mongo.
Diffstat (limited to 'src/mongo/db/stats/storage_stats.cpp')
-rw-r--r-- | src/mongo/db/stats/storage_stats.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mongo/db/stats/storage_stats.cpp b/src/mongo/db/stats/storage_stats.cpp index f741f7fe482..8a9a343f31a 100644 --- a/src/mongo/db/stats/storage_stats.cpp +++ b/src/mongo/db/stats/storage_stats.cpp @@ -38,7 +38,7 @@ namespace mongo { -Status appendCollectionStorageStats(OperationContext* txn, +Status appendCollectionStorageStats(OperationContext* opCtx, const NamespaceString& nss, const BSONObj& param, BSONObjBuilder* result) { @@ -54,7 +54,7 @@ Status appendCollectionStorageStats(OperationContext* txn, bool verbose = param["verbose"].trueValue(); - AutoGetCollectionForRead ctx(txn, nss); + AutoGetCollectionForRead ctx(opCtx, nss); if (!ctx.getDb()) { return {ErrorCodes::BadValue, str::stream() << "Database [" << nss.db().toString() << "] not found."}; @@ -66,34 +66,34 @@ Status appendCollectionStorageStats(OperationContext* txn, str::stream() << "Collection [" << nss.toString() << "] not found."}; } - long long size = collection->dataSize(txn) / scale; + long long size = collection->dataSize(opCtx) / scale; result->appendNumber("size", size); - long long numRecords = collection->numRecords(txn); + long long numRecords = collection->numRecords(opCtx); result->appendNumber("count", numRecords); if (numRecords) - result->append("avgObjSize", collection->averageObjectSize(txn)); + result->append("avgObjSize", collection->averageObjectSize(opCtx)); RecordStore* recordStore = collection->getRecordStore(); result->appendNumber( "storageSize", - static_cast<long long>(recordStore->storageSize(txn, result, verbose ? 1 : 0)) / scale); + static_cast<long long>(recordStore->storageSize(opCtx, result, verbose ? 1 : 0)) / scale); - recordStore->appendCustomStats(txn, result, scale); + recordStore->appendCustomStats(opCtx, result, scale); IndexCatalog* indexCatalog = collection->getIndexCatalog(); - result->append("nindexes", indexCatalog->numIndexesReady(txn)); + result->append("nindexes", indexCatalog->numIndexesReady(opCtx)); BSONObjBuilder indexDetails; - IndexCatalog::IndexIterator i = indexCatalog->getIndexIterator(txn, false); + IndexCatalog::IndexIterator i = indexCatalog->getIndexIterator(opCtx, false); while (i.more()) { const IndexDescriptor* descriptor = i.next(); IndexAccessMethod* iam = indexCatalog->getIndex(descriptor); invariant(iam); BSONObjBuilder bob; - if (iam->appendCustomStats(txn, &bob, scale)) { + if (iam->appendCustomStats(opCtx, &bob, scale)) { indexDetails.append(descriptor->indexName(), bob.obj()); } } @@ -101,7 +101,7 @@ Status appendCollectionStorageStats(OperationContext* txn, result->append("indexDetails", indexDetails.obj()); BSONObjBuilder indexSizes; - long long indexSize = collection->getIndexSize(txn, &indexSizes, scale); + long long indexSize = collection->getIndexSize(opCtx, &indexSizes, scale); result->appendNumber("totalIndexSize", indexSize / scale); result->append("indexSizes", indexSizes.obj()); |