diff options
author | dwight <dwight@10gen.com> | 2010-12-26 11:07:06 -0500 |
---|---|---|
committer | dwight <dwight@10gen.com> | 2010-12-26 11:07:06 -0500 |
commit | f35b33da44147deeb664eb0f2b8bcc696be5bcce (patch) | |
tree | 3bbcf4351568c07b769b12d7ccc79211f5bd0daa /db/dur.cpp | |
parent | 4260a74dbdbbe7ece95a5ab4fb8460370eef915a (diff) | |
download | mongo-f35b33da44147deeb664eb0f2b8bcc696be5bcce.tar.gz |
dur towards stats
Diffstat (limited to 'db/dur.cpp')
-rw-r--r-- | db/dur.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/db/dur.cpp b/db/dur.cpp index 5d9bfb611be..eb9844d4aae 100644 --- a/db/dur.cpp +++ b/db/dur.cpp @@ -73,10 +73,19 @@ namespace mongo { Stats stats; - Stats::Stats() { + void Stats::S::reset() { memset(this, 0, sizeof(*this)); } + BSONObj Stats::S::asObj() { + return BSON( + "commits" << _commits << + "journaledMB" << _journaledBytes / 1000000.0 << + "writeToDataFileMB" << _writeToDataFilesBytes / 1000000.0 << + "commitsInWriteLock" << _commitsInWriteLock + ); + } + DurableInterface* DurableInterface::_impl = new NonDurableImpl(); void NonDurableImpl::startup() { @@ -265,7 +274,7 @@ namespace mongo { std::stringstream ss; ss << "dur error warning views mismatch " << mmf->filename() << ' ' << (hex) << low << ".." << high << " len:" << high-low+1; log() << ss.str() << endl; - log() << "priv loc: " << (void*)(p+low) << ' ' << stats.curr._objCopies << endl; + log() << "priv loc: " << (void*)(p+low) << ' ' << endl; set<WriteIntent>& b = commitJob.writes(); (void)b; // mark as unused. Useful for inspection in debugger |