Skip to content

Instantly share code, notes, and snippets.

@jstrellner
Last active November 29, 2015 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstrellner/d69af11cc24da7d43fc2 to your computer and use it in GitHub Desktop.
Save jstrellner/d69af11cc24da7d43fc2 to your computer and use it in GitHub Desktop.
Print the status of all index rebuilds.
db.currentOp().inprog.forEach(
function(op) {
if ((op.secs_running > 5) && (op.op == "query")) {
if ((op.msg !== undefined) && (op.msg.indexOf("%") != -1)) {
print(op.ns + " - " + op.msg + "\n");
}
}
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment