summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2009-02-09 16:24:56 -0500
committerDwight <dmerriman@gmail.com>2009-02-09 16:24:56 -0500
commit5390dbc920d050bb59787c5c9bc1bdba03d25191 (patch)
tree817be360de5488cfca140b5203deefebd560baac /db
parent52ac9edf310f747e1ac3a14c741c4e07821fb876 (diff)
parent166716bb25aefc6887939a0c35b9df36b8bc01f4 (diff)
downloadmongo-5390dbc920d050bb59787c5c9bc1bdba03d25191.tar.gz
Merge branch 'master' of git.10gen.com:/data/gitroot/p
Diffstat (limited to 'db')
-rw-r--r--db/db.h6
-rw-r--r--db/dbwebserver.cpp9
-rw-r--r--db/instance.cpp1
-rw-r--r--db/instance.h2
4 files changed, 15 insertions, 3 deletions
diff --git a/db/db.h b/db/db.h
index 48e430001ca..e98cc395374 100644
--- a/db/db.h
+++ b/db/db.h
@@ -18,6 +18,7 @@
#include "../stdafx.h"
#include "../util/message.h"
+#include "../util/top.h"
namespace mongo {
@@ -76,6 +77,7 @@ namespace mongo {
~dblock() {
/* todo: this should be inlined */
dbunlocking();
+ Top::clientStop();
}
};
@@ -129,7 +131,8 @@ namespace mongo {
variables.
*/
assert( dbMutexInfo.isLocked() );
-
+ Top::clientStart( ns );
+
curNs = ns;
string key = getKey( ns, path );
map<string,Database*>::iterator it = databases.find(key);
@@ -191,6 +194,7 @@ namespace mongo {
#else
boost::detail::thread::lock_ops<boost::mutex>::unlock(dbMutex);
#endif
+ Top::clientStop();
}
~dbtemprelease() {
#if BOOST_VERSION >= 103500
diff --git a/db/dbwebserver.cpp b/db/dbwebserver.cpp
index 29a97b65058..690a4805483 100644
--- a/db/dbwebserver.cpp
+++ b/db/dbwebserver.cpp
@@ -67,6 +67,7 @@ namespace mongo {
{
Timer lktm;
dblock lk;
+ Top::completeSnapshot();
q = (q+1)%NStats;
Timing timing;
dbMutexInfo.timingInfo(timing.start, timing.timeLocked);
@@ -127,6 +128,14 @@ namespace mongo {
if ( !seemCaughtUp ) ss << "</b>";
ss << '\n';
+ ss << "\n<b>DBTOP</b>\n";
+ ss << "<table border=1><tr align='left'><th>Namespace</th><th>%</th><th>Time</th>";
+ vector< Top::Usage > usage;
+ Top::usage( usage );
+ for( vector< Top::Usage >::iterator i = usage.begin(); i != usage.end(); ++i )
+ ss << setprecision( 2 ) << fixed << "<tr><td>" << i->ns << "</td><td>" << i->pct << "</td><td>" << i->time << "</td></tr>\n";
+ ss << "</table>";
+
ss << "\n<b>dt\ttlocked</b>\n";
unsigned i = q;
while ( 1 ) {
diff --git a/db/instance.cpp b/db/instance.cpp
index 41152a0f7c4..8674415d0ee 100644
--- a/db/instance.cpp
+++ b/db/instance.cpp
@@ -650,5 +650,4 @@ namespace mongo {
::exit(rc);
}
-
} // namespace mongo
diff --git a/db/instance.h b/db/instance.h
index 95de541b455..334090aa5b9 100644
--- a/db/instance.h
+++ b/db/instance.h
@@ -127,5 +127,5 @@ namespace mongo {
boost::thread_specific_ptr< AuthenticationInfo > backup_;
};
};
-
+
} // namespace mongo