コード例 #1
0
ファイル: snapshots.cpp プロジェクト: BendustiK/mongo
        void run( stringstream& ss ) {
            auto_ptr<SnapshotDelta> delta = statsSnapshots.computeDelta();
            if ( ! delta.get() )
                return;

            ss << "<table border=1 cellpadding=2 cellspacing=0>";
            ss << "<tr align='left'><th>";
            ss << a("http://www.mongodb.org/display/DOCS/Developer+FAQ#DeveloperFAQ-What%27sa%22namespace%22%3F", "namespace") <<
               "NS</a></th>"
               "<th colspan=2>total</th>"
               "<th colspan=2>Reads</th>"
               "<th colspan=2>Writes</th>"
               "<th colspan=2>Queries</th>"
               "<th colspan=2>GetMores</th>"
               "<th colspan=2>Inserts</th>"
               "<th colspan=2>Updates</th>"
               "<th colspan=2>Removes</th>";
            ss << "</tr>\n";

            display( ss , (double) delta->elapsed() , "TOTAL" , delta->globalUsageDiff() );

            Top::UsageMap usage = delta->collectionUsageDiff();
            for ( Top::UsageMap::iterator i=usage.begin(); i != usage.end(); i++ ) {
                display( ss , (double) delta->elapsed() , i->first , i->second );
            }

            ss << "</table>";

        }
コード例 #2
0
ファイル: dbwebserver.cpp プロジェクト: whachoe/mongo
        // caller locks
        void doLockedStuff(stringstream& ss) {
            ss << "# databases: " << dbHolder.size() << '\n';

            ss << bold(ClientCursor::byLocSize()>10000) << "Cursors byLoc.size(): " << ClientCursor::byLocSize() << bold() << '\n';
            ss << "\n<b>replication</b>\n";
            ss << "master: " << replSettings.master << '\n';
            ss << "slave:  " << replSettings.slave << '\n';
            if ( replPair ) {
                ss << "replpair:\n";
                ss << replPair->getInfo();
            }
            bool seemCaughtUp = getInitialSyncCompleted();
            if ( !seemCaughtUp ) ss << "<b>";
            ss <<   "initialSyncCompleted: " << seemCaughtUp;
            if ( !seemCaughtUp ) ss << "</b>";
            ss << '\n';
            
            auto_ptr<SnapshotDelta> delta = statsSnapshots.computeDelta();
            if ( delta.get() ){
                ss << "\n<b>DBTOP  (occurences|percent of elapsed)</b>\n";
                ss << "<table border=1>";
                ss << "<tr align='left'>";
                ss << "<th>NS</th>"
                      "<th colspan=2>total</th>"
                      "<th colspan=2>Reads</th>"
                      "<th colspan=2>Writes</th>"
                      "<th colspan=2>Queries</th>"
                      "<th colspan=2>GetMores</th>"
                      "<th colspan=2>Inserts</th>"
                      "<th colspan=2>Updates</th>"
                      "<th colspan=2>Removes</th>";
                ss << "</tr>";
                
                display( ss , (double) delta->elapsed() , "GLOBAL" , delta->globalUsageDiff() );
                
                Top::UsageMap usage = delta->collectionUsageDiff();
                for ( Top::UsageMap::iterator i=usage.begin(); i != usage.end(); i++ ){
                    display( ss , (double) delta->elapsed() , i->first , i->second );
                }
                
                ss << "</table>";
            }

            statsSnapshots.outputLockInfoHTML( ss );

            BackgroundOperation::dump(ss);
        }