mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
downsample logging
This commit is contained in:
parent
9eee098af4
commit
e72acacf17
1 changed files with 3 additions and 2 deletions
|
@ -35,11 +35,12 @@ module.exports = EventLogger =
|
|||
return # order is ok
|
||||
if (count == previous)
|
||||
metrics.inc "event.#{channel}.duplicate"
|
||||
logger.warn {channel:channel, message_id:message_id}, "duplicate event"
|
||||
if Math.random() < 0.01
|
||||
logger.warn {channel:channel, message_id:message_id}, "duplicate event (sampled at 1%)"
|
||||
return "duplicate"
|
||||
else
|
||||
metrics.inc "event.#{channel}.out-of-order"
|
||||
logger.warn {channel:channel, message_id:message_id, key:key, previous: previous, count:count}, "out of order event"
|
||||
# logger.warn {channel:channel, message_id:message_id, key:key, previous: previous, count:count}, "out of order event"
|
||||
return "out-of-order"
|
||||
|
||||
_storeEventCount: (key, count) ->
|
||||
|
|
Loading…
Reference in a new issue