View Source Flagsmith.Client.Analytics.Processor (flagsmith_engine v0.1.0)
Link to this section Summary
Functions
Starts and links a gen_server represented by this module, using a
t:Flagsmith.Configuration.t
as the basis to derive its registration name and
inner details.
Given a t:Flagsmith.Schemas.Features.FeatureState.t
or
t:Flagsmith.Schemas.Features.Feature.t
or t:Flagsmith.Schemas.Flag.t
and an
t:Flagsmith.Schemas.Environment.t
or t:Flagsmith.Configuration.t
add or
increment the call count for feature id to be reported to the analytics endpoint.
If :enable_analytics
in the configuration value of the environment isn't true
it's a no op and returns (:noop), otherwise if the feature/flag doesn't have an
id it returns an error.
Returns the pid of Analytics.Processor process related to a given environment key, or :undefined if one can't be found.
Link to this section Types
Specs
env_or_config() :: Flagsmith.Schemas.Environment.t() | Flagsmith.Configuration.t()
Specs
environment_key() :: String.t()
Specs
feature_type() :: Flagsmith.Schemas.Features.FeatureState.t() | Flagsmith.Schemas.Features.Feature.t() | Flagsmith.Schemas.Flag
Specs
identity_id() :: String.t() | non_neg_integer()
Specs
processor_identifier() :: {Flagsmith.Client.Analytics.Processor, String.t()}
Link to this section Functions
Specs
start_link(Flagsmith.Configuration.t()) :: {:ok, pid()}
Starts and links a gen_server represented by this module, using a
t:Flagsmith.Configuration.t
as the basis to derive its registration name and
inner details.
Specs
track(feature_type(), env_or_config()) :: :ok | :noop | {:error, {:invalid_feature, term()}}
Given a t:Flagsmith.Schemas.Features.FeatureState.t
or
t:Flagsmith.Schemas.Features.Feature.t
or t:Flagsmith.Schemas.Flag.t
and an
t:Flagsmith.Schemas.Environment.t
or t:Flagsmith.Configuration.t
add or
increment the call count for feature id to be reported to the analytics endpoint.
If :enable_analytics
in the configuration value of the environment isn't true
it's a no op and returns (:noop), otherwise if the feature/flag doesn't have an
id it returns an error.
Otheriwse it automatically starts a process for the given environment key in case one is not running.
It's a non-blocking operation.
Specs
whereis(environment_key()) :: :undefined | pid()
Returns the pid of Analytics.Processor process related to a given environment key, or :undefined if one can't be found.