Scripts k6 — Plan de estrés IPSExtractor
Requieren k6 y el stack en http://127.0.0.1:8189.
Entorno de referencia (obligatorio en informes)
Las pruebas de carga del proyecto se calibran para el host:
- Hostname:
ubuntu(ASUS X441UAK) - SO: Ubuntu 24.04.4 LTS
- CPU / RAM: i5-7200U, 8 GiB
- Docker compartido con MLflow (~1.8 GiB), Airflow, n8n, MinIO, etc.
Antes de cada corrida, adjuntar al informe:
hostnamectl | head -5
free -h
docker stats --no-stream
curl -s -w '\ntime=%{time_total}s\n' http://127.0.0.1:8189/health/live
Perfiles (PROFILE)
| Valor | Cuándo |
|---|---|
shared8g (default) |
Host actual con otros contenedores |
lab |
Solo IPSExtractor, ≥3 GiB libres |
Variables
| Variable | Default | Descripción |
|---|---|---|
BASE_URL |
http://127.0.0.1:8189 |
Gateway |
PROFILE |
shared8g |
Perfil de carga |
BOT_API_TOKEN |
dev-token-change-me |
Bearer bot |
DOWNLOAD_JOB_ID |
— | Obligatorio en events |
WORKER_PREFIX |
load-w |
Prefijo heartbeats |
PDF_B64 |
(PDF mínimo) | PDF para count |
Ejecución
k6 run -e PROFILE=shared8g -e BASE_URL=http://127.0.0.1:8189 k6_gateway_health.js
k6 run -e PROFILE=shared8g -e BOT_API_TOKEN=dev-token-change-me k6_bot_heartbeats.js
k6 run -e PROFILE=shared8g -e DOWNLOAD_JOB_ID=<id> k6_bot_events.js
k6 run -e PROFILE=shared8g k6_smoke_suite.js
# Solo si free -h muestra ≥3GiB disponibles:
k6 run -e PROFILE=shared8g k6_count_batches.js
# o Python (PDFs reales, Windows-friendly):
.\docs\plan_pruebas\scripts\st_count_01_bench.ps1 -Profile shared8g
# Latencia count-api con PDFs reales:
bash docs/plan_pruebas/scripts/measure_count_latency.sh
# Latencia LLM ST-EXT-02 (mismo schema/campos, gpt-5.4-mini):
bash docs/plan_pruebas/scripts/st_ext_02_llm_bench.sh
# Windows: .\docs\plan_pruebas\scripts\st_ext_02_llm_bench.ps1 -Limit 10
# Cola ARQ ST-EXT-01 (LLM mock, sin coste OpenAI):
# 1) Mock (otra terminal) + extraction con ASYNC_QUEUE=true y EXTRACTOR_BASE_URL→mock
bash docs/plan_pruebas/scripts/llm_mock_server.sh
# 2) Bench (shared8g ≈30 docs / lab ≈200):
bash docs/plan_pruebas/scripts/st_ext_01_arq_bench.sh
PROFILE=lab ARQ_BENCH_LIMIT=100 bash docs/plan_pruebas/scripts/st_ext_01_arq_bench.sh
# Windows:
# .\docs\plan_pruebas\scripts\llm_mock_server.ps1
# .\docs\plan_pruebas\scripts\st_ext_01_arq_bench.ps1 -Profile shared8g -Limit 30
# .\docs\plan_pruebas\scripts\st_ext_01_arq_bench.ps1 -StartMock -Limit 20
Modelo de capacidad 100k/mes: estimate_capacity.md. Informe PDF: ../InformePruebas_IPSExtractor.pdf.
PDFs de prueba: ../data/ (500000284335937.pdf, ...940.pdf, ...954.pdf).
Tras el bench LLM: resultados en ../informe/sections/13_llm_latency.tex
(CSV informes/llm_latency_20260717.csv). Schema: informes/st_ext_02_schema.json.