diff options
author | Dwight <dwight@10gen.com> | 2011-06-21 13:22:59 -0400 |
---|---|---|
committer | Dwight <dwight@10gen.com> | 2011-06-21 13:22:59 -0400 |
commit | 473a982fab35b080f8d6fdc11f6bda5dd21e3397 (patch) | |
tree | 70311d091538904a13070078eea8da2110f21777 /tools | |
parent | add206436e566d6659d5e1f00dbc6e63c6dcd436 (diff) | |
download | mongo-473a982fab35b080f8d6fdc11f6bda5dd21e3397.tar.gz |
small sniffer improvements
Diffstat (limited to 'tools')
-rw-r--r-- | tools/sniffer.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/sniffer.cpp b/tools/sniffer.cpp index dc31fea4186..6f7ff337901 100644 --- a/tools/sniffer.cpp +++ b/tools/sniffer.cpp @@ -279,7 +279,7 @@ void processMessage( Connection& c , Message& m ) { if ( m.operation() == mongo::opReply ) out() << " - " << (unsigned)m.header()->responseTo; - out() << endl; + out() << '\n'; try { switch( m.operation() ) { @@ -294,7 +294,16 @@ void processMessage( Connection& c , Message& m ) { } case mongo::dbQuery: { mongo::QueryMessage q(d); - out() << "\tquery: " << q.query << " ntoreturn: " << q.ntoreturn << " ntoskip: " << q.ntoskip << endl; + out() << "\tquery: " << q.query << " ntoreturn: " << q.ntoreturn << " ntoskip: " << q.ntoskip; + if( !q.fields.isEmpty() ) + out() << " hasfields"; + if( q.queryOptions & mongo::QueryOption_SlaveOk ) + out() << " SlaveOk"; + if( q.queryOptions & mongo::QueryOption_NoCursorTimeout ) + out() << " NoCursorTimeout"; + if( q.queryOptions & ~(mongo::QueryOption_SlaveOk | mongo::QueryOption_NoCursorTimeout) ) + out() << " queryOptions:" << hex << q.queryOptions; + out() << endl; break; } case mongo::dbUpdate: { @@ -331,6 +340,7 @@ void processMessage( Connection& c , Message& m ) { break; } default: + out() << "\tunknown opcode " << m.operation() << endl; cerr << "*** CANNOT HANDLE TYPE: " << m.operation() << endl; } } |