Skip to content

Instantly share code, notes, and snippets.

View rsantosdev's full-sized avatar
🏠
Working from home

Rafael dos Santos rsantosdev

🏠
Working from home
View GitHub Profile
@iCyLand
iCyLand / w3c.conf
Last active April 18, 2022 15:25
W3C json log format for nginx
## this GeoIP dat file relate on centos environment please change to your OS path
geoip_country /usr/share/GeoIP/GeoIP-initial.dat;
map $request_uri $request_uri_path {
"~^(?P<path>[^?]*)(\?.*)?$" $path;
}
map $upstream_response_time $new_upstream_response_time {
default $upstream_response_time;
'' null;
@rsantosdev
rsantosdev / rethinkdb-slow.js
Created April 15, 2016 12:41
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();