Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Rafael dos Santos rsantosdev

🏠
Working from home
View GitHub Profile
@rsantosdev
rsantosdev / rethinkdb-slow.js
Created Apr 15, 2016
Monitor or trace slow queries on rethinkdb cluster.
View rethinkdb-slow.js
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();