DVAnalytics class
The analytics pipeline for one install.
Constructors
-
DVAnalytics({required DVConsent consent, required DVDatabaseAdapter database, required DVAnalyticsSink store, List<
DVAnalyticsProvider> providers = const <DVAnalyticsProvider>[], Set<String> sensitiveFields = const <String>{}, int sessionCap = 1000, int batchSize = 100, DateTime clock()?, void onDiagnostic(String code, String message)?})
Properties
- anonymousId → String
-
The id events carry while nobody is signed in. Separate from the install
id crash reports carry, which are sent without analytics consent, and
replaced whenever consent is withdrawn or somebody signs out.
no setter
- batchSize → int
-
final
- consent → DVConsent
-
final
- database → DVDatabaseAdapter
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
idle
→ Future<
void> -
Completes once every queued write and rotation has.
no setter
-
providers
→ List<
DVAnalyticsProvider> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sessionCap → int
-
Events of one name per session past which the rest are dropped
(
DV-ANALYTICS-003). A runaway guard, not sampling: below it every event is kept.final - sessionId → String
-
no setter
- store → DVAnalyticsSink
-
final
- userId → String?
-
no setter
Methods
-
connectFlags(
{required DVConsentCategory category}) → void - Makes this pipeline Feature Flags' exposure sink.
-
ensureSchema(
) → Future< void> -
flush(
{Set< String> ? sinks}) → Future<int> - Delivers queued events in batches of batchSize, and returns how many deliveries succeeded.
-
identify(
String? userId) → void - Sets who later events belong to. Earlier events keep the id they had and nothing records that the two belong together.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pending(
) → Future< int> - How many deliveries are queued, one per event per sink.
-
privacyAdapters(
) → List< DVPrivacyAdapter> - The Data Compliance adapters for everything analytics holds: the store and the outbox, the consent records, and each provider.
-
registerJobs(
DVQueues queues) → void - Registers the flush handler on the durable job layer.
-
requestFlush(
{DVQueues queues = const DVQueues(), String queue = 'default'}) → Future< DVJobEnvelope< DVAnalyticsFlushJob> > - Queues a flush; a worker runs it.
-
startSession(
{String? id}) → Future< void> - Starts a session: a new session id and a new count for the cap.
-
toString(
) → String -
A string representation of this object.
inherited
-
track(
DVAnalyticsEvent event) → Future< DVTrackResult> - Checks consent, the cap and the payload, and queues the event.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- identityTable → const String
- identityTableSql → const String
- The identity table, made here and by the analytics runtime, which reads the install id before a pipeline exists.
- outboxTable → const String
- storeName → const String
- The name the application's own store is delivered to under.