Skip to content

Instantly share code, notes, and snippets.

@rsantosdev
Created April 15, 2016 12:41
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsantosdev/45ccb7f7dd88563d4bcee34f3185c458 to your computer and use it in GitHub Desktop.
Save rsantosdev/45ccb7f7dd88563d4bcee34f3185c458 to your computer and use it in GitHub Desktop.
Monitor or trace slow queries on rethinkdb cluster.
r.db("rethinkdb").table('jobs')
.filter(function(j){
return j('type').eq('query')
.and(j('duration_sec').gt(0.001))
.and(j('info')('query').match('jobs').eq(null))
.and(j('info')('query').match('rethinkdb').eq(null));
})
.changes();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment