Add k6 load test scripts for Voiceprint verification endpoints (FRE-4930)

- k6 script with P99 latency thresholds (enrollment <500ms, verification <250ms, model retrieval <100ms)
- Configurable 500 req/s sustained throughput for 5 minutes
- Mixed workload scenario + individual endpoint scenarios
- GitHub Actions workflow for automated load testing
- Runner script with environment configuration
- JSON result export for CI artifact collection
- .gitignore entry for load test results
This commit is contained in:
Senior Engineer
2026-05-09 07:50:29 -04:00
committed by Michael Freno
parent bce4787802
commit cb5851ec8c
5 changed files with 402 additions and 0 deletions

54
.github/workflows/load-test.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: Load Test
on:
push:
branches: [main]
workflow_dispatch:
inputs:
target_rps:
description: 'Target requests per second'
required: false
default: '500'
duration:
description: 'Test duration'
required: false
default: '300s'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
load-test-voiceprint:
name: Voiceprint Load Test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install k6
run: |
curl -s https://github.com/grafana/k6/releases/download/v0.50.0/k6-linux-amd64.tar.gz -L | tar xz
sudo mv k6 /usr/local/bin/
k6 version
- name: Run Voiceprint load tests
run: |
cd load-tests/voiceprint
./run.sh mixed
env:
VOICEPRINT_BASE_URL: ${{ secrets.LOAD_TEST_BASE_URL || 'http://localhost:3000' }}
API_TOKEN: ${{ secrets.LOAD_TEST_API_TOKEN || 'test-token' }}
TARGET_RPS: ${{ github.event.inputs.target_rps || '500' }}
DURATION: ${{ github.event.inputs.duration || '300s' }}
ENROLLMENT_P99_MS: '500'
VERIFICATION_P99_MS: '250'
MODEL_RETRIEVAL_P99_MS: '100'
- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: load-test-results-${{ github.sha }}
path: load-tests/voiceprint/results/
retention-days: 30