summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2010-08-23 11:24:34 -0400
committerEliot Horowitz <eliot@10gen.com>2010-08-31 17:26:56 -0400
commit66befc517c516a11408713b02dfc575cccf7cc29 (patch)
treed6a2578abac7db0c38e791a2bb692ca3063b4a81
parente070747d94e0dccfcab5ba2e385eb699c6993796 (diff)
downloadmongo-66befc517c516a11408713b02dfc575cccf7cc29.tar.gz
clean up diags clientcursor after changes
-rw-r--r--db/clientcursor.cpp6
-rw-r--r--db/clientcursor.h2
-rw-r--r--db/restapi.cpp4
3 files changed, 5 insertions, 7 deletions
diff --git a/db/clientcursor.cpp b/db/clientcursor.cpp
index 918b79b9e22..87f48105808 100644
--- a/db/clientcursor.cpp
+++ b/db/clientcursor.cpp
@@ -391,10 +391,8 @@ namespace mongo {
void ClientCursor::appendStats( BSONObjBuilder& result ){
recursive_scoped_lock lock(ccmutex);
result.appendNumber("totalOpen", clientCursorsById.size() );
- // todo ...
- // result.appendNumber("byLocation_size_thisdb", cc().database()->ccByLoc.size() );
- result.appendNumber("clientCursors_size", clientCursorsById.size() );
- result.appendNumber( "timedOut" , numberTimedOut );
+ result.appendNumber("clientCursors_size", numCursors());
+ result.appendNumber("timedOut" , numberTimedOut);
}
// QUESTION: Restrict to the namespace from which this command was issued?
diff --git a/db/clientcursor.h b/db/clientcursor.h
index b8502fc7764..e567758b9f5 100644
--- a/db/clientcursor.h
+++ b/db/clientcursor.h
@@ -336,7 +336,7 @@ public:
static void appendStats( BSONObjBuilder& result );
- static unsigned byLocSize(); // just for diagnostics
+ static unsigned numCursors() { return clientCursorsById.size(); }
static void informAboutToDeleteBucket(const DiskLoc& b);
static void aboutToDelete(const DiskLoc& dl);
diff --git a/db/restapi.cpp b/db/restapi.cpp
index 09e732e9b56..e9a7ae2214b 100644
--- a/db/restapi.cpp
+++ b/db/restapi.cpp
@@ -266,8 +266,8 @@ namespace mongo {
ss << "# databases: " << dbHolder.size() << '\n';
-// if( ClientCursor::byLocSize()>500 )
-// ss << "Cursors byLoc.size(): " << ClientCursor::byLocSize() << '\n';
+ if( ClientCursor::numCursors()>500 )
+ ss << "# Cursors: " << ClientCursor::numCursors() << '\n';
ss << "\nreplication: ";
if( *replInfo )