diff options
author | Louis Williams <louis.williams@mongodb.com> | 2018-12-05 13:10:36 -0500 |
---|---|---|
committer | Louis Williams <louis.williams@mongodb.com> | 2019-01-02 17:47:25 -0500 |
commit | 0f05363c0431e4b5e6e8b4dcc14ad124de387413 (patch) | |
tree | e60bd30355f14b560c671177108781d42c29f0e0 /src/mongo/db/curop.cpp | |
parent | 433cd9954456c66f94cbdff3a81c0cdaf71b0c2e (diff) | |
download | mongo-0f05363c0431e4b5e6e8b4dcc14ad124de387413.tar.gz |
SERVER-37265 Change curOp and ProgressMeter for hybrid builds
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r-- | src/mongo/db/curop.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index e76a248547f..e47d46452cf 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -341,21 +341,20 @@ void CurOp::setGenericOpRequestDetails(OperationContext* opCtx, _ns = nss.ns(); } -ProgressMeter& CurOp::setMessage_inlock(const char* msg, - std::string name, - unsigned long long progressMeterTotal, - int secondsBetween) { - if (progressMeterTotal) { - if (_progressMeter.isActive()) { - error() << "old _message: " << redact(_message) << " new message:" << redact(msg); - verify(!_progressMeter.isActive()); - } - _progressMeter.reset(progressMeterTotal, secondsBetween); - _progressMeter.setName(name); - } else { - _progressMeter.finished(); +void CurOp::setMessage_inlock(StringData message) { + if (_progressMeter.isActive()) { + error() << "old _message: " << redact(_message) << " new message:" << redact(message); + verify(!_progressMeter.isActive()); } - _message = msg; + _message = message.toString(); // copy +} + +ProgressMeter& CurOp::setProgress_inlock(StringData message, + unsigned long long progressMeterTotal, + int secondsBetween) { + setMessage_inlock(message); + _progressMeter.reset(progressMeterTotal, secondsBetween); + _progressMeter.setName(message); return _progressMeter; } |