[erlang-questions] Reporting gen_server timings

Jay Nelson jay@REDACTED
Sat May 31 06:03:54 CEST 2014

The other suggestions are probably more direct and easier to integrate
with Poolboy since you want to record the time waiting for available workers,
but I have a library called Epocxy (https://github.com/duomark/epocxy)
which includes ring buffers in ets. It is easy to use those to record timings
concurrently. There is also a concurrency control (cxy_ctl.erl) module which
automatically times executions (it uses a ring buffer which overwrites
older values continuously, so you always have a window into the last N
executions). You can either use concurrency, or set the concurrency
configuration to ‘none’ and get synchronous inline execution but still have
the timings recorded. When spawning, you get a timing for the initialization
time and the execution time, but the times are not recorded until the spawn
execution completes or fails. If you can arrange the init of a newly spawned
request to block until a worker is available, you should automatically get both
timings you want.


More information about the erlang-questions mailing list