summaryrefslogtreecommitdiff
path: root/src/mongo/db/collection_index_usage_tracker.cpp
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@10gen.com>2015-09-30 17:41:56 -0400
committerJames Wahlin <james.wahlin@10gen.com>2015-10-07 15:42:22 -0400
commitec97a61067e2dc3f9c4e58a9d66b5e1f2600f978 (patch)
tree40c67ec652a87b17b794a8ba5fc5aa3b4fc3e99e /src/mongo/db/collection_index_usage_tracker.cpp
parent33167b814bb9d8962205a85fed34c9d88942db83 (diff)
downloadmongo-ec97a61067e2dc3f9c4e58a9d66b5e1f2600f978.tar.gz
SERVER-20520 Include index key in $indexStats return documents
Diffstat (limited to 'src/mongo/db/collection_index_usage_tracker.cpp')
-rw-r--r--src/mongo/db/collection_index_usage_tracker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/collection_index_usage_tracker.cpp b/src/mongo/db/collection_index_usage_tracker.cpp
index 10894bcfe6e..9b1d0e17b22 100644
--- a/src/mongo/db/collection_index_usage_tracker.cpp
+++ b/src/mongo/db/collection_index_usage_tracker.cpp
@@ -49,12 +49,12 @@ void CollectionIndexUsageTracker::recordIndexAccess(StringData indexName) {
_indexUsageMap[indexName].accesses.fetchAndAdd(1);
}
-void CollectionIndexUsageTracker::registerIndex(StringData indexName) {
+void CollectionIndexUsageTracker::registerIndex(StringData indexName, const BSONObj& indexKey) {
invariant(!indexName.empty());
dassert(_indexUsageMap.find(indexName) == _indexUsageMap.end());
// Create map entry.
- _indexUsageMap[indexName] = IndexUsageStats(_clockSource->now());
+ _indexUsageMap[indexName] = IndexUsageStats(_clockSource->now(), indexKey);
}
void CollectionIndexUsageTracker::unregisterIndex(StringData indexName) {