mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-28 23:23:38 -05:00
Sort out initialization and ignore noisy mongo requests
This commit is contained in:
parent
42b500263a
commit
15f85494b7
2 changed files with 6 additions and 2 deletions
|
@ -6,8 +6,8 @@ name = "unknown"
|
||||||
buildKey = (key)-> "#{name}.#{process.env.NODE_ENV or "development"}.#{key}"
|
buildKey = (key)-> "#{name}.#{process.env.NODE_ENV or "development"}.#{key}"
|
||||||
|
|
||||||
module.exports =
|
module.exports =
|
||||||
initialize: (options = {}) ->
|
initialize: (name) ->
|
||||||
name = options.name
|
name = name
|
||||||
|
|
||||||
set : (key, value, sampleRate = 1)->
|
set : (key, value, sampleRate = 1)->
|
||||||
statsd.set buildKey(key), value, sampleRate
|
statsd.set buildKey(key), value, sampleRate
|
||||||
|
|
|
@ -15,6 +15,10 @@ module.exports =
|
||||||
options = {}
|
options = {}
|
||||||
callback = () ->
|
callback = () ->
|
||||||
|
|
||||||
|
if db_command.query? and (db_command.query["ping"] or db_command.query["ismaster"])
|
||||||
|
# Ignore noisy methods
|
||||||
|
return _method.call this, db_command, options, callback
|
||||||
|
|
||||||
key = "mongo-requests.#{type}"
|
key = "mongo-requests.#{type}"
|
||||||
if db_command.query?
|
if db_command.query?
|
||||||
query = Object.keys(db_command.query).sort().join("_")
|
query = Object.keys(db_command.query).sort().join("_")
|
||||||
|
|
Loading…
Reference in a new issue