Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use function capture for attaching
handle_event/4
(#107)
The documentation for `:telemetry.attach/4` states that function capture should be used for the event handler, rather than local function capture for performance reasons. Using local function capture also leads to warnings like: ``` https://hexdocs.pm/telemetry/telemetry.html#attach/4 [info] The function passed as a handler with ID {Telemetry.Metrics.ConsoleReporter, [:phoenix, :router_dispatch, :start], #PID<0.576.0>} is a local function. This means that it is either an anonymous function or a capture of a function without a module specified. That may cause a performance penalty when calling that handler. For more details see the note in `telemetry:attach/4` documentation. ``` Unfortunately, to allow using function capture, I've had to make `handle_event/4` a public function. Co-authored-by: Nick Spain <nicholas.spain96@gmail.com>
- Loading branch information