New Relixir v0.5.0 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
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 theQueryable
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
.
Instruments a database call and records the elapsed time.
action
is the name of the operation being instrumented.sql
is theSQL Instruction
being passed to the transaction recorder.params
a list of parameters to be used on the prepared statement.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
.