0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

access to progress meter in db.currentOp() SERVER-2167

This commit is contained in:
Eliot Horowitz 2011-05-17 10:50:12 -04:00
parent 821f38fb8a
commit ce83d98bcf
2 changed files with 10 additions and 8 deletions

View File

@ -395,6 +395,10 @@ namespace mongo {
StringBuilder buf(128);
buf << _message.toString() << " " << _progressMeter.toString();
b.append( "msg" , buf.str() );
BSONObjBuilder sub( b.subobjStart( "progress" ) );
sub.appendNumber( "done" , (long long)_progressMeter.done() );
sub.appendNumber( "total" , (long long)_progressMeter.total() );
sub.done();
}
else {
b.append( "msg" , _message.toString() );

View File

@ -284,18 +284,16 @@ namespace mongo {
return true;
}
unsigned long long done() {
return _done;
}
unsigned long long hits() {
return _hits;
}
void setTotalWhileRunning( unsigned long long total ) {
_total = total;
}
unsigned long long done() const { return _done; }
unsigned long long hits() const { return _hits; }
unsigned long long total() const { return _total; }
string toString() const {
if ( ! _active )
return "";