QueryStats

CI PipelineHex.pmDocumentation

QueryStats is a library that provides a way to track the number of queries executed by Ecto during test suite runs.

After a run, it will output the total number of queries and the number of queries per type.

Output example

Total queries: 10
Query types:
  INSERT: 5
  SELECT: 5

Installation

If available in Hex, the package can be installed by adding query_stats to your list of dependencies in mix.exs:

def deps do
  [
    {:query_stats, "~> 0.1.0"}
  ]
end

Then, in your test_helper.exs file, add the following line:

QueryStats.start(:my_app)

Replace :my_app with the name of your application.