SelectoComponents.Performance.MetricsCollector (selecto_components v0.4.5)

Collects and stores performance metrics for Selecto queries.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Clears all metrics.

Gets current metrics.

Gets query timeline data.

Callback implementation for GenServer.init/1.

Records cache hit/miss.

Records an error.

Starts the metrics collector.

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

clear_metrics()

Clears all metrics.

Link to this function

get_metrics(time_range \\ "1h")

Gets current metrics.

Link to this function

get_slow_queries(threshold \\ 500, limit \\ 10)

Gets slow queries.

Link to this function

get_timeline(time_range \\ "1h")

Gets query timeline data.

Callback implementation for GenServer.init/1.

Link to this function

record_cache(hit?)

Records cache hit/miss.

Link to this function

record_error(query, error)

Records an error.

Link to this function

record_query(query, execution_time, opts \\ %{})

Records a query execution.

Link to this function

start_link(opts \\ [])

Starts the metrics collector.