Phoenix.Endpoint.instrument/4

Parsed documentation:
View on GitHub
Instruments the given function using the instrumentation provided by
the given endpoint.

To specify the endpoint that will provide instrumentation, the first argument
can be:

  * a module name - the endpoint itself
  * a `Plug.Conn` struct - this macro will look for the endpoint module in the
    `:private` field of the connection; if it's not there, `fun` will be
    executed with no instrumentation
  * a `Phoenix.Socket` struct - this macro will look for the endpoint module in the
    `:endpoint` field of the socket; if it's not there, `fun` will be
    executed with no instrumentation

Usually, users should prefer to instrument events using the `c:instrument/3`
macro defined in every Phoenix endpoint. This macro should only be used for
cases when the endpoint is dynamic and not known at compile time.

## Examples

    endpoint = MyApp.Endpoint
    Phoenix.Endpoint.instrument endpoint, :render_view, fn -> ... end
Suggestions:
Please help! Open an issue on GitHub if this assessment is incorrect.