Skip to content

Commit

Permalink
RUM-1837 Add configuration telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejburda committed Nov 6, 2023
1 parent e04dfb6 commit 53b36cc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DatadogCore/Sources/Datadog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ public struct Datadog {
)

core.telemetry.configuration(
backgroundTaskEnabled: configuration.backgroundTasksEnabled,
batchProcessingLevel: Int64(exactly: configuration.batchProcessingLevel.maxBatchesPerUpload),
batchSize: Int64(exactly: performance.maxFileSize),
batchUploadFrequency: performance.minUploadDelay.toInt64Milliseconds,
useLocalEncryption: configuration.encryption != nil,
Expand Down
8 changes: 8 additions & 0 deletions DatadogInternal/Sources/Telemetry/Telemetry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public struct ConfigurationTelemetry: Equatable {
public let actionNameAttribute: String?
public let allowFallbackToLocalStorage: Bool?
public let allowUntrustedEvents: Bool?
public let backgroundTaskEnabled: Bool?
public let batchProcessingLevel: Int64?
public let batchSize: Int64?
public let batchUploadFrequency: Int64?
public let dartVersion: String?
Expand Down Expand Up @@ -178,6 +180,8 @@ extension Telemetry {
actionNameAttribute: String? = nil,
allowFallbackToLocalStorage: Bool? = nil,
allowUntrustedEvents: Bool? = nil,
backgroundTaskEnabled: Bool? = nil,
batchProcessingLevel: Int64? = nil,
batchSize: Int64? = nil,
batchUploadFrequency: Int64? = nil,
dartVersion: String? = nil,
Expand Down Expand Up @@ -227,6 +231,8 @@ extension Telemetry {
actionNameAttribute: actionNameAttribute,
allowFallbackToLocalStorage: allowFallbackToLocalStorage,
allowUntrustedEvents: allowUntrustedEvents,
backgroundTaskEnabled: backgroundTaskEnabled,
batchProcessingLevel: batchProcessingLevel,
batchSize: batchSize,
batchUploadFrequency: batchUploadFrequency,
dartVersion: dartVersion,
Expand Down Expand Up @@ -331,6 +337,8 @@ extension ConfigurationTelemetry {
actionNameAttribute: other.actionNameAttribute ?? actionNameAttribute,
allowFallbackToLocalStorage: other.allowFallbackToLocalStorage ?? allowFallbackToLocalStorage,
allowUntrustedEvents: other.allowUntrustedEvents ?? allowUntrustedEvents,
backgroundTaskEnabled: other.backgroundTaskEnabled ?? backgroundTaskEnabled,
batchProcessingLevel: other.batchProcessingLevel ?? batchProcessingLevel,
batchSize: other.batchSize ?? batchSize,
batchUploadFrequency: other.batchUploadFrequency ?? batchUploadFrequency,
dartVersion: other.dartVersion ?? dartVersion,
Expand Down
2 changes: 2 additions & 0 deletions DatadogInternal/Tests/Telemetry/TelemetryMocks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ extension ConfigurationTelemetry {
actionNameAttribute: .mockRandom(),
allowFallbackToLocalStorage: .mockRandom(),
allowUntrustedEvents: .mockRandom(),
backgroundTaskEnabled: .mockRandom(),
batchProcessingLevel: .mockRandom(),
batchSize: .mockRandom(),
batchUploadFrequency: .mockRandom(),
dartVersion: .mockRandom(),
Expand Down
2 changes: 2 additions & 0 deletions DatadogInternal/Tests/Telemetry/TelemetryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ class TelemetryTest: Telemetry {
actionNameAttribute: configuration.actionNameAttribute,
allowFallbackToLocalStorage: configuration.allowFallbackToLocalStorage,
allowUntrustedEvents: configuration.allowUntrustedEvents,
backgroundTaskEnabled: configuration.backgroundTaskEnabled,
batchProcessingLevel: configuration.batchProcessingLevel,
batchSize: configuration.batchSize,
batchUploadFrequency: configuration.batchUploadFrequency,
dartVersion: configuration.dartVersion,
Expand Down

0 comments on commit 53b36cc

Please sign in to comment.