From b592255ce7ccb8aba29ea0e8ac767370b686ad87 Mon Sep 17 00:00:00 2001 From: David Leek Date: Wed, 29 May 2024 08:37:20 +0200 Subject: [PATCH] chore: remove unused artillery scripts referencing state api (#7194) --- perf/README.md | 32 -------------------------------- perf/env.sh | 4 ---- perf/seed/.gitignore | 1 - perf/seed/export.sh | 12 ------------ perf/seed/import.sh | 13 ------------- perf/test/.gitignore | 2 -- perf/test/artillery.sh | 13 ------------- perf/test/artillery.yaml | 12 ------------ perf/test/gzip.sh | 25 ------------------------- 9 files changed, 114 deletions(-) delete mode 100644 perf/README.md delete mode 100644 perf/env.sh delete mode 100644 perf/seed/.gitignore delete mode 100755 perf/seed/export.sh delete mode 100755 perf/seed/import.sh delete mode 100644 perf/test/.gitignore delete mode 100755 perf/test/artillery.sh delete mode 100644 perf/test/artillery.yaml delete mode 100755 perf/test/gzip.sh diff --git a/perf/README.md b/perf/README.md deleted file mode 100644 index ad01262c72..0000000000 --- a/perf/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# /perf - -Testing performance testing! Files of note: - -```shell -# Configure the app URL and auth token to use in performance testing. -./env.sh - -# Export all the data from the app at the configured URL. -./seed/export.sh - -# Import previously exported data to the app instance. -./seed/import.sh - -# Measure the GZIP response size for interesting endpoints. -./test/gzip.sh - -# Run a few load test scenarios against the app. -./test/artillery.sh -``` - -See also the following scripts in `package.json`: - -```shell -# Fill the unleash_testing/seed schema with seed data. -$ yarn seed:setup - -# Serve the unleash_testing/seed schema data, for exports. -$ yarn seed:serve -``` - -Edit files in `/test/e2e/seed` to change the amount data. diff --git a/perf/env.sh b/perf/env.sh deleted file mode 100644 index b6ff97d4fd..0000000000 --- a/perf/env.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -export PERF_AUTH_KEY="*:*.964a287e1b728cb5f4f3e0120df92cb5" -export PERF_APP_URL="http://localhost:4242" diff --git a/perf/seed/.gitignore b/perf/seed/.gitignore deleted file mode 100644 index 4df8098eac..0000000000 --- a/perf/seed/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/export.json diff --git a/perf/seed/export.sh b/perf/seed/export.sh deleted file mode 100755 index 4bace24222..0000000000 --- a/perf/seed/export.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -feu - -cd "$(dirname "$0")" - -. ../env.sh - -# Export data. Delete environments since they can't be imported. -curl -H "Authorization: $PERF_AUTH_KEY" "$PERF_APP_URL/api/admin/state/export" \ - | jq 'del(.environments)' \ - > export.json diff --git a/perf/seed/import.sh b/perf/seed/import.sh deleted file mode 100755 index 0fe59b703a..0000000000 --- a/perf/seed/import.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -feu - -cd "$(dirname "$0")" - -. ../env.sh - -curl -X POST \ - -H "Content-Type: application/json" \ - -H "Authorization: $PERF_AUTH_KEY" \ - -d @export.json \ - "$PERF_APP_URL/api/admin/state/import?drop=true&keep=false" diff --git a/perf/test/.gitignore b/perf/test/.gitignore deleted file mode 100644 index 2275e0aad6..0000000000 --- a/perf/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/artillery.json -/artillery.json.html diff --git a/perf/test/artillery.sh b/perf/test/artillery.sh deleted file mode 100755 index 87655b8239..0000000000 --- a/perf/test/artillery.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -feu - -cd "$(dirname "$0")" - -. ../env.sh - -artillery run ./artillery.yaml --output artillery.json - -artillery report artillery.json - -echo "See artillery.json.html for results" diff --git a/perf/test/artillery.yaml b/perf/test/artillery.yaml deleted file mode 100644 index fef84bebdb..0000000000 --- a/perf/test/artillery.yaml +++ /dev/null @@ -1,12 +0,0 @@ -config: - target: "http://localhost:4242" - defaults: - headers: - authorization: "{{ $processEnvironment.PERF_AUTH_KEY }}" - phases: - - duration: 60 - arrivalRate: 10 -scenarios: - - flow: - - get: - url: "/api/client/features" diff --git a/perf/test/gzip.sh b/perf/test/gzip.sh deleted file mode 100755 index 77405b0412..0000000000 --- a/perf/test/gzip.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -set -feu - -cd "$(dirname "$0")" - -. ../env.sh - -print_response_size () { - local URL - local RES - URL="$1" - RES="$(curl -s -H "Authorization: $PERF_AUTH_KEY" "$URL")" - echo - echo "$URL" - echo - echo "* Byte size: $(echo "$RES" | wc -c) bytes" - echo "* GZIP size: $(echo "$RES" | gzip -6 | wc -c) bytes" -} - -print_response_size "$PERF_APP_URL/api/admin/projects" - -print_response_size "$PERF_APP_URL/api/admin/features" - -print_response_size "$PERF_APP_URL/api/client/features"