Contents

enabledStateReportingDomains

StateReporting domains enabled for metrics aggregation

Declaration

final var enabledStateReportingDomains: Set<StateReportingDomain> { get }

Discussion

When set, metrics will be delivered with StateReporting stable state context, broken down by the application states recorded in the specified domains. This manager will receive metric entries matching the enabled domains as well as non-state-aggregated metric entries.

Example

let manager = MetricManager(enabledStateReportingDomains: [
    "com.myapp.gameplay",
    "com.myapp.experiments"
])

// Emit states using StateReporting directly
let reporter = StateReporter.reporter(for: "com.myapp.gameplay", stableState: GameState.self)

for await report in manager.metricReports {
    for entry in report.stateEntries {
        let domain = entry.state.domain
    }

    // Full day aggregate
    let fullDay = report.intervalEntries.fullDayEntry
}

See Also

Initialization