Skip to content

Commit

Permalink
Merge pull request #2184 from DataDog/release/2.23.0
Browse files Browse the repository at this point in the history
Release 2.23.0

Co-authored-by: maxep <[email protected]>
Co-authored-by: mariedm <[email protected]>
Co-authored-by: simaoseica-dd <[email protected]>
Co-authored-by: ncreated <[email protected]>
Co-authored-by: maciejburda <[email protected]>
Co-authored-by: dd-mergequeue[bot] <121105855+dd-mergequeue[bot]@users.noreply.github.com>
Co-authored-by: Reallnas <[email protected]>
Co-authored-by: gonzalezreal <[email protected]>
  • Loading branch information
8 people authored Feb 5, 2025
2 parents 0e33fbf + 2f97fe6 commit 9311393
Show file tree
Hide file tree
Showing 242 changed files with 18,922 additions and 463 deletions.
785 changes: 779 additions & 6 deletions BenchmarkTests/BenchmarkTests.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</EnvironmentVariable>
<EnvironmentVariable
key = "BENCHMARK_SCENARIO"
value = "sessionReplay"
value = "sessionReplaySwiftUI"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ struct SessionReplayScenario: Scenario {
SessionReplay.enable(
with: SessionReplay.Configuration(
replaySampleRate: 100,
defaultPrivacyLevel: .allow
textAndInputPrivacyLevel: .maskSensitiveInputs,
imagePrivacyLevel: .maskNone,
touchPrivacyLevel: .show
)
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2019-Present Datadog, Inc.
*/

import Foundation
import UIKit
import SwiftUI

import DatadogCore
import DatadogRUM
import DatadogSessionReplay

import SwiftUICatalog

struct SessionReplaySwiftUIScenario: Scenario {
var initialViewController: UIViewController {
UIHostingController(rootView: SwiftUICatalog.ContentView(monitor: DatadogMonitor()))
}

func instrument(with info: AppInfo) {
Datadog.initialize(
with: .benchmark(info: info),
trackingConsent: .granted
)

RUM.enable(
with: RUM.Configuration(
applicationID: info.applicationID
)
)

SessionReplay.enable(
with: SessionReplay.Configuration(
replaySampleRate: 100,
textAndInputPrivacyLevel: .maskSensitiveInputs,
imagePrivacyLevel: .maskNone,
touchPrivacyLevel: .show,
featureFlags: [.swiftui: true]
)
)

RUMMonitor.shared().addAttribute(forKey: "scenario", value: "SessionReplaySwiftUI")
}
}

private struct DatadogMonitor: SwiftUICatalog.DatadogMonitor {
func viewModifier(name: String) -> AnyViewModifier {
AnyViewModifier { content in
content.trackRUMView(name: name)
}
}

func actionModifier(name: String) -> AnyViewModifier {
AnyViewModifier { content in
content.trackRUMTapAction(name: name)
}
}
}
3 changes: 3 additions & 0 deletions BenchmarkTests/Runner/Scenarios/SyntheticScenario.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ internal struct SyntheticScenario: Scenario {
/// The Synthetics benchmark scenario value.
internal enum Name: String {
case sessionReplay
case sessionReplaySwiftUI
}
/// The scenario's name.
let name: Name
Expand All @@ -36,6 +37,8 @@ internal struct SyntheticScenario: Scenario {
switch name {
case .sessionReplay:
_scenario = SessionReplayScenario()
case .sessionReplaySwiftUI:
_scenario = SessionReplaySwiftUIScenario()
}

self.name = name
Expand Down
23 changes: 23 additions & 0 deletions BenchmarkTests/SwiftUICatalog/AnyViewModifier.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2019-Present Datadog, Inc.
*/

import SwiftUI

public struct AnyViewModifier: ViewModifier {
private let _body: (Content) -> AnyView

public init<Body: View>(@ViewBuilder body: @escaping (Content) -> Body) {
self._body = { AnyView(body($0)) }
}

public init() {
self._body = { AnyView($0) }
}

public func body(content: Content) -> some View {
_body(content)
}
}
6 changes: 6 additions & 0 deletions BenchmarkTests/SwiftUICatalog/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.038",
"green" : "0.005",
"red" : "0.020"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.323",
"green" : "0.680",
"red" : "0.596"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.122",
"green" : "0.122",
"red" : "0.129"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"colors" : [
{
"color" : {
"platform" : "universal",
"reference" : "labelColor"
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"platform" : "ios",
"reference" : "labelColor"
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.651",
"green" : "0.173",
"red" : "0.388"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "0.976",
"red" : "0.973"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.651",
"green" : "0.173",
"red" : "0.388"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "5347-github_102542.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9311393

Please sign in to comment.