New Relixir v0.4.5 NewRelixir.Plug.Instrumentation View Source

Utility methods for instrumenting parts of an Ecto app.

Link to this section Summary

Functions

Instruments a database call and records the elapsed time

Link to this section Functions

Link to this function instrument_db(action, queryable, opts, f) View Source
instrument_db(atom(), Ecto.Queryable.t(), Keyword.t(), (... -> any())) :: any()

Instruments a database call and records the elapsed time.

  • action is the name of the repository function being instrumented.
  • queryable is the Queryable being passed to the repository.
  • opts is a keyword list of overrides to parts of the recorded transaction name.
  • f is the function to be instrumented.

By default, the query name will be inferred from queryable and action. This can be overriden by providing a :query option in opts.