Skip to content

Instantly share code, notes, and snippets.

@davemackintosh
Last active August 29, 2015 14:12
Show Gist options
  • Save davemackintosh/c49f61a4842020acb350 to your computer and use it in GitHub Desktop.
Save davemackintosh/c49f61a4842020acb350 to your computer and use it in GitHub Desktop.
Mongo STARTUP2 index ETA
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