Last active
August 29, 2015 14:12
-
-
Save davemackintosh/c49f61a4842020acb350 to your computer and use it in GitHub Desktop.
Mongo STARTUP2 index ETA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var op = db.currentOp().inprog[0]; | |
var persec = op.progress.done / op.secs_running; | |
var time = ((op.progress.total - op.progress.done) / persec) / 60 / 60; | |
var unit = 'hours'; | |
if (time < 1.0 && time > 0.0) { | |
unit = 'minutes'; | |
time = 60 * time; | |
} | |
print( | |
op.progress.done, 'done and', (op.progress.total - op.progress.done), 'remaining \n', | |
persec, 'per second. remaining time', time, unit | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment