View Source QueryStats.Counter (query_stats v0.1.1)

This module is responsible for keeping track of query statistics.

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns the total count of queries.

Returns the count of each query type.

Increments the total count of queries.

Increments the count of a specific query type.

Resets the counter.

Starts the counter agent.

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec get_total() :: integer()

Returns the total count of queries.

@spec get_types() :: map()

Returns the count of each query type.

@spec increment_total() :: :ok

Increments the total count of queries.

@spec increment_type(String.t()) :: :ok

Increments the count of a specific query type.

@spec reset() :: :ok

Resets the counter.

@spec start_link() :: {:ok, pid()} | {:error, term()}

Starts the counter agent.