EventOptimizationManager class

Manages event optimization by determining when to include device/app data

This class implements the SDK Send Optimization feature from GitHub issue #37. The goal is to reduce payload size by omitting extra.device and extra.app data from most events, only including them when necessary.

Full device/app data is included in these cases:

  • First event of the application lifecycle
  • First event of a new session
  • Every 100th event (configurable via fullDataInterval)
  • Crash events (always include full data for debugging)
  • When device or app data changes (detected via comparison)

This optimization significantly reduces the size of event transmissions while maintaining sufficient context for debugging and analytics.

Constructors

EventOptimizationManager()

Properties

eventCount int
Get current event count (for debugging)
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionEventCount int
no setter

Methods

getOptimizationReason(bool shouldIncludeFullData, bool isCrashEvent, String currentSessionId, App currentApp, Device currentDevice) String
Get human-readable reason for optimization decision
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resetForNewSession() → void
Reset counters for new session
shouldIncludeFullData(ObslyEventBase event, String currentSessionId, App currentApp, Device currentDevice, bool isCrashEvent) bool
Check if device/app data should be included for this event
toString() String
A string representation of this object.
inherited
updateEventCount() → void
Update event counters

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

fullDataInterval → const int