Skip to content

Commit 1876736

Browse files
committed
ci: Move replay metrics into dedicated package
1 parent 20a970c commit 1876736

Some content is hidden

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

66 files changed

+1069
-10523
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,8 @@ jobs:
793793
run: |
794794
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
795795
796-
replay_metrics:
797-
name: Replay Metrics
796+
overhead_metrics:
797+
name: Overhead metrics
798798
needs: [job_get_metadata, job_build]
799799
runs-on: ubuntu-20.04
800800
timeout-minutes: 30
@@ -819,18 +819,14 @@ jobs:
819819
path: ${{ env.CACHED_BUILD_PATHS }}
820820
key: ${{ env.BUILD_CACHE_KEY }}
821821

822-
- name: Setup
823-
run: yarn install
824-
working-directory: packages/replay/metrics
825-
826822
- name: Collect
827823
run: yarn ci:collect
828-
working-directory: packages/replay/metrics
824+
working-directory: packages/overhead-metrics
829825

830826
- name: Process
831827
id: process
832828
run: yarn ci:process
833-
working-directory: packages/replay/metrics
829+
working-directory: packages/overhead-metrics
834830
# Don't run on forks - the PR comment cannot be added.
835831
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
836832
env:

.vscode/launch.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,6 @@
3737
"internalConsoleOptions": "openOnSessionStart",
3838
"outputCapture": "std"
3939
},
40-
{
41-
"type": "node",
42-
"name": "Debug replay metrics collection script",
43-
"request": "launch",
44-
"cwd": "${workspaceFolder}/packages/replay/metrics/",
45-
"program": "${workspaceFolder}/packages/replay/metrics/configs/dev/collect.ts",
46-
"preLaunchTask": "Build Replay metrics script",
47-
},
48-
{
49-
"type": "node",
50-
"name": "Debug replay metrics processing script",
51-
"request": "launch",
52-
"cwd": "${workspaceFolder}/packages/replay/metrics/",
53-
"program": "${workspaceFolder}/packages/replay/metrics/configs/dev/process.ts",
54-
"preLaunchTask": "Build Replay metrics script",
55-
},
5640
// Run rollup using the config file which is in the currently active tab.
5741
{
5842
"name": "Debug rollup (config from open file)",

.vscode/tasks.json

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
{
22
// See https://go.microsoft.com/fwlink/?LinkId=733558 for documentation about `tasks.json` syntax
3-
"version": "2.0.0",
4-
"tasks": [
5-
{
6-
"label": "Prepare nextjs integration test app for VSCode debugger",
7-
"type": "npm",
8-
"script": "predebug",
9-
"path": "packages/nextjs/test/integration/",
10-
"detail": "Link the SDK (if not already linked) and build test app",
11-
},
12-
{
13-
"label": "Build Replay metrics script",
14-
"type": "npm",
15-
"script": "build",
16-
"path": "packages/replay/metrics",
17-
}
18-
]
3+
"version": "2.0.0",
4+
"tasks": [
5+
{
6+
"label": "Prepare nextjs integration test app for VSCode debugger",
7+
"type": "npm",
8+
"script": "predebug",
9+
"path": "packages/nextjs/test/integration/",
10+
"detail": "Link the SDK (if not already linked) and build test app"
11+
}
12+
]
1913
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"packages/hub",
4545
"packages/integration-tests",
4646
"packages/integrations",
47+
"packages/overhead-metrics",
4748
"packages/nextjs",
4849
"packages/node",
4950
"packages/node-integration-tests",

packages/replay/metrics/.eslintrc.cjs renamed to packages/overhead-metrics/.eslintrc.cjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
extends: ['../.eslintrc.js'],
2+
extends: ['../../.eslintrc.js'],
33
ignorePatterns: ['test-apps'],
44
overrides: [
55
{
@@ -8,6 +8,9 @@ module.exports = {
88
'no-console': 'off',
99
'@typescript-eslint/no-non-null-assertion': 'off',
1010
'import/no-unresolved': 'off',
11+
'@sentry-internal/sdk/no-optional-chaining': 'off',
12+
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
13+
'jsdoc/require-jsdoc': 'off',
1114
},
1215
},
1316
],

packages/replay/metrics/README.md renamed to packages/overhead-metrics/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Replay performance metrics
1+
# Overhead performance metrics
22

3-
Evaluates Replay impact on website performance by running a web app in Chromium via Playwright and collecting various metrics.
3+
Evaluates Sentry & Replay impact on website performance by running a web app in Chromium via Playwright and collecting various metrics.
44

5-
The general idea is to run a web app without Sentry Replay and then run the same app again with Sentry and another one with Sentry+Replay included.
5+
The general idea is to run a web app without Sentry, and then run the same app again with Sentry and another one with Sentry+Replay included.
66
For the three scenarios, we collect some metrics (CPU, memory, vitals) and later compare them and post as a comment in a PR.
77
Changes in the metrics, compared to previous runs from the main branch, should be evaluated on case-by-case basis when preparing and reviewing the PR.
88

packages/replay/metrics/configs/ci/collect.ts renamed to packages/overhead-metrics/configs/ci/collect.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { Metrics, MetricsCollector } from '../../src/collector.js';
2-
import { MetricsStats, NumberProvider } from '../../src/results/metrics-stats.js';
1+
import type { Metrics} from '../../src/collector.js';
2+
import { MetricsCollector } from '../../src/collector.js';
3+
import type { NumberProvider } from '../../src/results/metrics-stats.js';
4+
import { MetricsStats } from '../../src/results/metrics-stats.js';
35
import { JankTestScenario } from '../../src/scenarios.js';
46
import { printStats } from '../../src/util/console.js';
57
import { latestResultFile } from './env.js';

packages/replay/metrics/configs/dev/collect.ts renamed to packages/overhead-metrics/configs/dev/collect.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Metrics, MetricsCollector } from '../../src/collector.js';
1+
import type { Metrics} from '../../src/collector.js';
2+
import { MetricsCollector } from '../../src/collector.js';
23
import { MetricsStats } from '../../src/results/metrics-stats.js';
34
import { JankTestScenario } from '../../src/scenarios.js';
45
import { printStats } from '../../src/util/console.js';

packages/replay/metrics/package.json renamed to packages/overhead-metrics/package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
{
22
"private": true,
3-
"name": "metrics",
3+
"version": "7.36.0",
4+
"name": "@sentry-internal/overhead-metrics",
45
"main": "index.js",
56
"author": "Sentry",
67
"license": "MIT",
78
"type": "module",
89
"scripts": {
910
"build": "tsc",
10-
"deps": "yarn --cwd ../ build:bundle && yarn --cwd ../../tracing/ build:bundle",
1111
"dev:collect": "ts-node-esm ./configs/dev/collect.ts",
1212
"dev:process": "ts-node-esm ./configs/dev/process.ts",
1313
"ci:collect": "ts-node-esm ./configs/ci/collect.ts",
14-
"ci:process": "ts-node-esm ./configs/ci/process.ts"
14+
"ci:process": "ts-node-esm ./configs/ci/process.ts",
15+
"fix": "run-s fix:eslint fix:prettier",
16+
"fix:eslint": "eslint . --format stylish --fix",
17+
"fix:prettier": "prettier --write \"{src,test,scripts,worker}/**/*.ts\"",
18+
"lint": "run-s lint:prettier lint:eslint",
19+
"lint:eslint": "eslint . --format stylish",
20+
"lint:prettier": "prettier --check \"{src,test,scripts,worker}/**/*.ts\""
1521
},
1622
"dependencies": {
1723
"@octokit/rest": "^19.0.5",

0 commit comments

Comments
 (0)