Skip to content

Commit 86976f2

Browse files
[RUM-12600] Continuous Benchmarking (#3927)
1 parent c07a0f9 commit 86976f2

File tree

118 files changed

+63606
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+63606
-2
lines changed

.gitlab-ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,20 @@ bump-chrome-version-scheduled-failure:
587587
dependencies:
588588
- bump-chrome-version-scheduled
589589

590+
########################################################################################################################
591+
# Performance benchmark
592+
########################################################################################################################
593+
594+
performance-benchmark:
595+
stage: task
596+
extends: .base-configuration
597+
only:
598+
variables:
599+
- $TARGET_TASK_NAME == "performance-benchmark-scheduled"
600+
script:
601+
- yarn
602+
- yarn test:performance
603+
590604
########################################################################################################################
591605
# Check expired telemetry
592606
########################################################################################################################

LICENSE-3rdparty.csv

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ dev,@types/node-forge,MIT,Copyright Microsoft Corporation
2424
dev,@types/pako,MIT,Copyright Microsoft Corporation
2525
dev,@types/react,MIT,Copyright Microsoft Corporation
2626
dev,@types/react-dom,MIT,Copyright Microsoft Corporation
27+
dev,@types/react-window,MIT,Copyright Microsoft Corporation
28+
dev,@vitejs/plugin-react,MIT,Copyright (c) 2019-present Evan You & Vite Contributors
2729
dev,@webextension-toolbox/webpack-webextension-plugin,MIT,Copyright 2018 Henrik Wenz ([email protected])
2830
dev,ajv,MIT,Copyright 2015-2017 Evgeny Poberezkin
2931
dev,browserstack-local,MIT,Copyright 2016 BrowserStack
@@ -60,13 +62,16 @@ dev,pako,MIT,(C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
6062
dev,prettier,MIT,Copyright James Long and contributors
6163
dev,puppeteer,Apache-2.0,Copyright 2017 Google Inc.
6264
dev,react-router-dom,MIT,Copyright (c) React Training LLC 2015-2019 Copyright (c) Remix Software Inc. 2020-2021 Copyright (c) Shopify Inc. 2022-2023
65+
dev,react-window,MIT,Copyright (c) 2018 Brian Vaughn
66+
dev,recharts,MIT,Copyright (c) 2015-present recharts
6367
dev,style-loader,MIT,Copyright JS Foundation and other contributors
6468
dev,terser-webpack-plugin,MIT,Copyright JS Foundation and other contributors
6569
dev,ts-loader,MIT,Copyright 2015 TypeStrong
6670
dev,ts-node,MIT,Copyright 2014 Blake Embrey
6771
dev,tsconfig-paths-webpack-plugin,MIT,Copyright 2016 Jonas Kello
6872
dev,typescript,Apache-2.0,Copyright Microsoft Corporation
6973
dev,typescript-eslint,MIT,Copyright (c) 2019 typescript-eslint and other contributors
74+
dev,vite,MIT,Copyright (c) 2019-present, VoidZero Inc. and Vite contributors
7075
dev,webpack,MIT,Copyright JS Foundation and other contributors
7176
dev,webpack-cli,MIT,Copyright JS Foundation and other contributors
7277
dev,webpack-dev-middleware,MIT,Copyright JS Foundation and other contributors

eslint.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export default tseslint.config(
2626
'packages/*/esm',
2727
'developer-extension/dist',
2828
'test/**/dist',
29+
'test/apps/react-heavy-spa',
30+
'test/apps/react-shopist-like',
2931
'sandbox',
3032
'coverage',
3133
'rum-events-format',
@@ -50,6 +52,7 @@ export default tseslint.config(
5052
'./tsconfig.scripts.json',
5153
'./developer-extension/tsconfig.webpack.json',
5254
'./test/e2e/tsconfig.json',
55+
'./test/performance/tsconfig.json',
5356
'./performances/tsconfig.json',
5457

5558
'./test/apps/**/tsconfig.json',
@@ -453,7 +456,7 @@ export default tseslint.config(
453456
},
454457

455458
{
456-
files: ['test/e2e/**/*.ts'],
459+
files: ['test/e2e/**/*.ts', 'test/performance/**/*.ts'],
457460
rules: {
458461
// E2E codebase is importing @datadog/browser-* packages referenced by tsconfig.
459462
'import/no-extraneous-dependencies': 'off',

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"packages/*",
77
"developer-extension",
88
"performances",
9-
"test/e2e"
9+
"test/e2e",
10+
"test/performance"
1011
],
1112
"type": "module",
1213
"scripts": {
@@ -35,6 +36,9 @@
3536
"test:e2e:ci:bs": "yarn build && yarn build:apps && yarn test:e2e:bs",
3637
"test:compat:tsc": "node scripts/check-typescript-compatibility.ts",
3738
"test:compat:ssr": "scripts/cli check_server_side_rendering_compatibility",
39+
"test:performance": "yarn test:e2e:init && playwright test --config test/performance/playwright.config.ts",
40+
"test:performance:debug": "playwright test --config test/performance/playwright.config.ts --debug",
41+
"test:performance:ui": "playwright test --config test/performance/playwright.config.ts --ui",
3842
"json-schemas:sync": "scripts/cli update_submodule && yarn json-schemas:generate",
3943
"json-schemas:generate": "scripts/cli build_json2type && node scripts/generate-schema-types.ts",
4044
"size": "node scripts/show-bundle-size.ts",

scripts/build/build-test-apps.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ runMain(async () => {
1616

1717
buildApp('test/apps/vanilla')
1818
buildApp('test/apps/react-router-v6-app')
19+
buildApp('test/apps/react-heavy-spa')
20+
buildApp('test/apps/react-shopist-like')
1921
await buildReactRouterv7App()
2022
await buildExtensions()
2123

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
node_modules
3+
.yarn/*
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# React Heavy SPA - Observability App
2+
3+
A complex, JavaScript-heavy single-page application built with React + TypeScript for performance benchmarking and profiling of Datadog Browser SDK.
4+
5+
## Pages
6+
7+
- 📊 **Dashboard** – Displays metrics cards, charts, and a service grid using Recharts. Triggering CLS due to multiple large dataset fetches.
8+
- 📝 **Logs Explorer** – Provides log search, filtering, and a virtualized table with 2,000 logs.
9+
- 🖥️ **Infrastructure** – Visualizes a host map and table with 3,000 hosts, where heavy DOM manipulation causes INP delays during filtering or interaction.
10+
- ⚙️ **Settings** – Manages user and team settings with form submissions.
11+
12+
## Performance metrics target
13+
14+
Target to have Web Vitals in the “Needs improvement” score range.
15+
16+
- **LCP**: ~3000ms
17+
- **CLS**: ~0.13
18+
- **INP**: ~300ms
19+
- **TBT**: ~45000ms
20+
21+
## Getting Started
22+
23+
### Prerequisites
24+
25+
- Node.js 20+ (recommended)
26+
- Yarn (uses Yarn by default)
27+
28+
### Installation
29+
30+
```bash
31+
# Install dependencies
32+
yarn install
33+
```
34+
35+
### Development
36+
37+
```bash
38+
# Run development server (opens browser automatically)
39+
yarn dev
40+
```
41+
42+
The app will be available at `http://localhost:5173`
43+
44+
### Building for Production
45+
46+
```bash
47+
# Create production build (includes TypeScript compilation)
48+
yarn build
49+
50+
# Preview production build
51+
yarn preview
52+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/dd_icon_rgb.png" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Heavy SPA Benchmark - Datadog Web UI</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "heavy-spa",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite --open",
8+
"build": "tsc -b && vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"@datadog/browser-rum": "^6.23.0",
13+
"react": "^18.3.1",
14+
"react-dom": "^18.3.1",
15+
"react-router-dom": "^6.20.0",
16+
"react-window": "^1.8.10",
17+
"recharts": "^2.10.0"
18+
},
19+
"devDependencies": {
20+
"@types/node": "^24.9.1",
21+
"@types/react": "^18.3.12",
22+
"@types/react-dom": "^18.3.1",
23+
"@types/react-window": "^1.8.8",
24+
"@vitejs/plugin-react": "^4.3.3",
25+
"globals": "^15.11.0",
26+
"typescript": "~5.6.2",
27+
"vite": "^5.4.10"
28+
}
29+
}

0 commit comments

Comments
 (0)