mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
ffa523bced
should indicate if node is blocking on libuv threads as described in https://nodejs.org/api/dns.html#dns_dns_lookup
18 lines
467 B
CoffeeScript
18 lines
467 B
CoffeeScript
seconds = 1000
|
|
|
|
module.exports = EventLoopMonitor =
|
|
monitor: (logger) ->
|
|
interval = setInterval () ->
|
|
EventLoopMonitor.Delay()
|
|
, 1 * seconds
|
|
Metrics = require "./metrics"
|
|
Metrics.registerDestructor () ->
|
|
clearInterval(interval)
|
|
|
|
Delay: () ->
|
|
Metrics = require "./metrics"
|
|
t1 = process.hrtime()
|
|
setImmediate () ->
|
|
delta = process.hrtime(t1)
|
|
responseTime = delta[0]*1e6 + delta[1]*1e-3
|
|
Metrics.timing("event-loop-microsec", responseTime)
|