You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: benchmarks/README.md
+31-19Lines changed: 31 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
2. From the iOS folder, run `pod install`.
7
7
3. From the root folder, run `yarn ios` or `yarn android`.
8
8
9
-
## Enable new architcture
9
+
## Enable new architecture
10
10
11
11
### iOS
12
12
@@ -20,7 +20,7 @@ Set `newArchEnabled=true` in `benchmarks/android/gradle.properties`.
20
20
21
21
## ENV config
22
22
23
-
The `.env` config file contains configuration for the Datadog API, as well as a test scenario that you can launch when the app boots up. If it doesn't contain a test scenario, the app waits for a deeplink to trigger a test scenario instead.
23
+
The `.env` config file contains a configuration for the Datadog API, as well as a test scenario that you can launch when the app boots up. If it doesn't contain a test scenario, the app waits for a deep link to trigger a test scenario instead.
24
24
25
25
DD_CLIENT_TOKEN="CLIENT_TOKEN"
26
26
DD_API_KEY="API_KEY"
@@ -33,37 +33,43 @@ The `.env` config file contains configuration for the Datadog API, as well as a
adb shell am start -W -a android.intent.action.VIEW -d 'benchmark://stop' com.benchmarkrunner
96
102
```
97
103
98
-
## Adding a New Scenario to Benchmarks
104
+
## Adding a new scenario to benchmarks
99
105
100
-
### Define the New Scenario
106
+
### Define the new scenario
101
107
102
108
In `benchmarks/src/testSetup/types/testConfig.ts`, add a new entry to the `Scenario` enum:
103
109
@@ -110,22 +116,22 @@ export enum Scenario {
110
116
}
111
117
```
112
118
113
-
The string value (`'newScenario'`) is what must be passed using deeplink as the `scenario` parameter.
119
+
The string value (`'newScenario'`) is what must be passed using a deep link as the `scenario` parameter.
114
120
115
121
Alternatively, if you're using a `.env` file to set the scenario, add:
116
122
117
123
```env
118
124
BENCH_SCENARIO="newScenario"
119
125
```
120
126
121
-
### Create the Scenario Component
127
+
### Create the scenario component
122
128
123
129
Create a new folder under `benchmarks/src/scenario/` named after your scenario (for example, `NewScenario`). Inside this folder, define your scenario’s main component and its props.
@@ -144,7 +150,7 @@ function NewScenario(props: NewScenarioProps): React.JSX.Element {
144
150
exportdefaultNewScenario;
145
151
```
146
152
147
-
### Register the Scenario in the App
153
+
### Register the scenario in the app
148
154
149
155
In `benchmarks/src/App.tsx`, add a new case to the scenario switch using the enum identifier you just created:
150
156
@@ -153,9 +159,9 @@ case Scenario.NewScenario:
153
159
return <NewScenariotestConfig={testConfig} />;
154
160
```
155
161
156
-
You can now trigger this scenario either through a deeplink or by setting `BENCH_SCENARIO` in the `.env` file.
162
+
You can then trigger this scenario through either a deep link or by setting `BENCH_SCENARIO` in the `.env` file.
157
163
158
-
## Instrumenting a Scenario
164
+
## Instrument a scenario
159
165
160
166
Depending on the scenario’s structure and flow, the Datadog SDK initialization may vary. Each scenario is responsible for managing its own initialization logic.
161
167
@@ -178,5 +184,11 @@ useEffect(() => {
178
184
If your scenario uses the `DatadogProvider`, you can retrieve the necessary configuration using `getDatadogProviderConfig()` from the same `testUtils` module:
0 commit comments