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.
actionis the name of the repository function being instrumented.queryableis theQueryablebeing passed to the repository.optsis a keyword list of overrides to parts of the recorded transaction name.fis 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.
actionis the name of the operation being instrumented.sqlis theSQL Instructionbeing passed to the transaction recorder.paramsa list of parameters to be used on the prepared statement.optsis a keyword list of overrides to parts of the recorded transaction name.fis 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.