diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-03-16 16:18:36 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-03-16 16:18:36 -0400 |
commit | 10e373e07923a8b37eb9168fc56669ab583c22f0 (patch) | |
tree | abf3db9366a62a9b33843084d1b3acb3b5abd97d /db/stats | |
parent | 5af02ef16fee549244c1db2517224bb729872974 (diff) | |
download | mongo-10e373e07923a8b37eb9168fc56669ab583c22f0.tar.gz |
on a collection drop remove namespaces from Top SERVER-768
Diffstat (limited to 'db/stats')
-rw-r--r-- | db/stats/top.cpp | 5 | ||||
-rw-r--r-- | db/stats/top.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/db/stats/top.cpp b/db/stats/top.cpp index 7f42d79b957..0c1bd1900af 100644 --- a/db/stats/top.cpp +++ b/db/stats/top.cpp @@ -52,6 +52,11 @@ namespace mongo { _record( coll , op , lockType , micros , command ); _record( _global , op , lockType , micros , command ); } + + void Top::collectionDropped( const string& ns ){ + scoped_lock lk(_lock); + _usage.erase(ns); + } void Top::_record( CollectionData& c , int op , int lockType , long long micros , bool command ){ c.total.inc( micros ); diff --git a/db/stats/top.h b/db/stats/top.h index 9860733f5f8..1f977061666 100644 --- a/db/stats/top.h +++ b/db/stats/top.h @@ -70,7 +70,8 @@ namespace mongo { void append( BSONObjBuilder& b ); void cloneMap(UsageMap& out); CollectionData getGlobalData(){ return _global; } - + void collectionDropped( const string& ns ); + public: // static stuff static Top global; |