View Source SauceAnalytics.Store (sauce_analytics v0.1.2)
ETS store for tracking view and event sequence per user session.
options
Options
:table_name
- The name of the table that the ETS will use. Defaults to:sauce_analytic_session_table
:session_max_age
- The number of seconds before a session in the Store is considered expired. Defaults to3600
(1 hour):clean_interval
- The number of seconds that specify the period of time between each clean up of expired sessions. Defaults to5400
(1.5 hours)
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Returns true if an entry associated with the given session_id in the Store, false otherwise.
Returns the state/configuration of the SauceAnalytics.Store
GenServer.
Increments view_sequence or event_sequence on a session in the Store.
Returns an entry in the Store.
If an entry with the given session ID does not exist in the store, a new entry is created.
Creates a new entry in the Store.
Starts the Store GenServer with the given opts
.
Link to this section Types
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Returns true if an entry associated with the given session_id in the Store, false otherwise.
@spec get_state() :: SauceAnalytics.Store.State.t()
Returns the state/configuration of the SauceAnalytics.Store
GenServer.
@spec inc_sequence(session_id :: reference(), type :: :view | :event) :: :ok | {:error, :not_found}
Increments view_sequence or event_sequence on a session in the Store.
type
can either be :view
or :event
@spec lookup_entry(session_id :: reference()) :: {:ok, SauceAnalytics.Store.Entry.t()} | {:error, :not_found}
Returns an entry in the Store.
@spec maybe_restore_entry(session_id :: reference()) :: SauceAnalytics.Store.Entry.t() | nil
If an entry with the given session ID does not exist in the store, a new entry is created.
@spec new_entry(session_id :: reference()) :: {:ok, SauceAnalytics.Store.Entry.t()}
Creates a new entry in the Store.
@spec start_link([opts()]) :: GenServer.on_start()
Starts the Store GenServer with the given opts
.
Use this in your application supervision tree.