From b796fc1eb86bd093c11d23962b811441ec87dbad Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Tue, 23 Jun 2026 15:08:55 -0400 Subject: [PATCH 1/2] tests(perf): Add two very simple `homepage-*.yml` files --- README.md | 24 +++++++++++++++++++ .../load_tests/homepage-heavy-load.yml | 22 +++++++++++++++++ .../load_tests/homepage-light-load.yml | 22 +++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 integration/load_tests/homepage-heavy-load.yml create mode 100644 integration/load_tests/homepage-light-load.yml diff --git a/README.md b/README.md index 39901131df..be9bf9df32 100644 --- a/README.md +++ b/README.md @@ -150,11 +150,35 @@ npx playwright test all-scenarios --grep @search_for_a_subway_line ## Load Tests +### Full load test + ``` npm install --ignore-scripts npx artillery run ./integration/load_tests/all-scenarios.yml --target http://localhost:4001 ``` +### Light load test / performance test + +``` +npm install --ignore-scripts +npx artillery run ./integration/load_tests/homepage-light-load.yml +``` + +This is unlikely to stress your locally-running instance, but it will present output that includes something like + +``` +http.response_time.2xx: + min: ......................................................................... 287 + max: ......................................................................... 558 + mean: ........................................................................ 416.7 + median: ...................................................................... 424.2 + p95: ......................................................................... 507.8 + p99: ......................................................................... 539.2 +``` + +This can be useful for comparing homepage load times across different commits or releases. + + ## Monitoring ``` diff --git a/integration/load_tests/homepage-heavy-load.yml b/integration/load_tests/homepage-heavy-load.yml new file mode 100644 index 0000000000..884d9491c0 --- /dev/null +++ b/integration/load_tests/homepage-heavy-load.yml @@ -0,0 +1,22 @@ +config: + target: "http://localhost:4001" + http: + timeout: 300 + maxSockets: 500 + phases: + - name: "Sustained high-load test" + duration: 300 + arrivalRate: 100 + environments: + green: + target: "http://dev-green.mbtace.com" + blue: + target: "http://dev-blue.mbtace.com" +scenarios: + - name: "Stress test single page" + flow: + - loop: + - get: + url: "/" + - think: 1 + count: 100 diff --git a/integration/load_tests/homepage-light-load.yml b/integration/load_tests/homepage-light-load.yml new file mode 100644 index 0000000000..ceb4d8db6e --- /dev/null +++ b/integration/load_tests/homepage-light-load.yml @@ -0,0 +1,22 @@ +config: + target: "http://localhost:4001" + http: + timeout: 300 + maxSockets: 500 + phases: + - name: "Warm Up" + duration: 30 + arrivalRate: 10 + - name: "Sustained light-load test" + duration: 60 + arrivalRate: 10 + environments: + green: + target: "http://dev-green.mbtace.com" + blue: + target: "http://dev-blue.mbtace.com" +scenarios: + - name: "Stress test single page" + flow: + - get: + url: "/" From a4178eeba5a9127603bbb8e6226c25e7d11a79c5 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Thu, 25 Jun 2026 15:56:21 -0400 Subject: [PATCH 2/2] tweak: Reduce `arrivalRate` in light-load config to avoid multiple simultaneous loads --- integration/load_tests/homepage-light-load.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/integration/load_tests/homepage-light-load.yml b/integration/load_tests/homepage-light-load.yml index ceb4d8db6e..6517c04c49 100644 --- a/integration/load_tests/homepage-light-load.yml +++ b/integration/load_tests/homepage-light-load.yml @@ -6,10 +6,10 @@ config: phases: - name: "Warm Up" duration: 30 - arrivalRate: 10 - - name: "Sustained light-load test" + arrivalRate: 3 + - name: "Measure page-load times" duration: 60 - arrivalRate: 10 + arrivalRate: 3 environments: green: target: "http://dev-green.mbtace.com"