npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

prix-r9

v2.0.4

Published

CLI para pruebas de carga HTTP/REST con ramp-up, multipart y escenarios encadenados por steps.

Downloads

746

Readme

Prix-R9

CLI para pruebas de carga HTTP/REST con ramp-up, multipart y escenarios encadenados por steps.

Caracteristicas

  • Ejecuta pruebas de carga con rate fijo o startRate -> targetRate.
  • Soporta requests JSON y multipart con archivo.
  • Permite escenarios encadenados dentro de una misma iteracion usando steps.
  • Extrae valores del response JSON y los reutiliza en los siguientes steps.
  • Soporta escenarios simples de un solo request y escenarios encadenados por steps.
  • Permite usar insecureHttps: true para endpoints HTTPS locales con certificados autofirmados.
  • Genera reporte.txt con metricas generales del escenario y metricas por step.

Instalacion

npm install -g prix-r9

Comandos

prix-r9 --config mi-config.json
prix-r9 --prompt
prix-r9-curl -i mi-curl.txt -o casos/mi-endpoint.json

Flujo recomendado desde cURL

  1. Exporta cada request funcional como cURL desde browser, Postman o Swagger.
  2. Convierte cada cURL a un JSON base:
    prix-r9-curl -i curl-upload.txt -o upload.json
    prix-r9-curl -i curl-execute.txt -o execute.json
  3. Toma esos JSON generados y unelos manualmente dentro de steps.
  4. En el step 1 agrega extract con la ruta exacta del valor devuelto.
  5. En el step 2 reemplaza el valor fijo por un placeholder {{variableExtraida}}.
  6. Ejecuta el escenario encadenado con prix-r9 --config escenario.json.

El importador prix-r9-curl genera configuraciones simples de un solo request. Eso es intencional: sirven como bloque base para construir escenarios multi-step.

Variables dinamicas

Se pueden usar en url, headers, body, file y filekey.

  • {{uuid}}
  • {{timestamp}}
  • {{random_number}}

Formato simple de un request

Este formato sigue funcionando sin cambios:

{
  "url": "https://api.example.test/v1/usuarios",
  "method": "POST",
  "startRate": 5,
  "targetRate": 50,
  "rampUpTime": 5,
  "duration": 10,
  "headers": {
    "Authorization": "Bearer {{uuid}}",
    "X-Request-ID": "{{uuid}}"
  },
  "body": {
    "id_unico": "{{uuid}}",
    "correo_usuario": "prueba_{{timestamp}}@example.test"
  }
}

Este formato representa un escenario de endpoint unico.

HTTPS local con certificados no confiables

Si necesitas probar un endpoint local como https://localhost:64847/... con certificado autofirmado o no confiable, puedes activar:

{
  "url": "https://localhost:64847/api/reportes/GetByCompany",
  "method": "POST",
  "rate": 1,
  "duration": 1,
  "insecureHttps": true,
  "headers": {
    "Content-Type": "application/json",
    "ApiKey": "dev-local-api-key"
  },
  "body": {
    "StartDate": "2026-03-01",
    "EndDate": "2026-03-17"
  }
}

Cuando insecureHttps es true, Prix-R9 usa un https.Agent con rejectUnauthorized: false.

Importante:

  • usalo solo en ambientes locales o de desarrollo
  • no lo uses en QA formal, staging productivo o produccion
  • con esto ya no necesitas ejecutar NODE_TLS_REJECT_UNAUTHORIZED=0
  • la herramienta muestra una advertencia en consola cuando esta opcion esta activa

En escenarios con steps, insecureHttps se puede declarar a nivel del escenario y aplica a todos los steps.

Formato recomendado para escenarios encadenados

La forma mas simple es usar steps con el mismo formato que genera prix-r9-curl, sin obligarte a anidar request.

{
  "name": "Carga encadenada de aprobacion",
  "startRate": 2,
  "targetRate": 5,
  "rampUpTime": 5,
  "duration": 10,
  "steps": [
    {
      "name": "uploadProcess",
      "url": "https://api.example.test/modulo-cargas/api/blob/uploadProcess",
      "method": "post",
      "headers": {
        "Accept": "application/json, text/plain, */*",
        "Authorization": "Bearer {{uuid}}"
      },
      "file": "./Plantillas/PlantillaMovimientoManual.csv",
      "filekey": "File",
      "body": {
        "TypeFile": "1",
        "ReasonProcess": "Carga ejemplo {{timestamp}}",
        "CreatedBy": "Usuario QA",
        "TypeProcessId": "11111111-2222-3333-4444-555555555555"
      },
      "extract": {
        "uploadFileProcessId": "$.uploadFileProcessId"
      }
    },
    {
      "name": "executeLoadProcess",
      "url": "https://api.example.test/modulo-cargas/api/approvals/ExecuteLoadProcess",
      "method": "post",
      "headers": {
        "Accept": "application/json, text/plain, */*",
        "Content-Type": "application/json",
        "apiKey": "example-api-key"
      },
      "body": {
        "UploadFileProcessId": "{{uploadFileProcessId}}",
        "AprovalStatus": 1,
        "ApprovedBy": "Usuario QA"
      }
    }
  ]
}

Tambien se acepta la forma anidada con request, pero la forma directa suele ser mas facil de mantener cuando vienes desde cURL.

Reglas de ejecucion

  • Cada iteracion crea su propio contexto.
  • variables define valores iniciales opcionales por iteracion.
  • extract guarda valores del response JSON para los steps siguientes.
  • Si un step falla por HTTP, red o extraccion, la iteracion termina y los steps restantes quedan omitidos por cascade.
  • En escenarios multi-step, el rate representa iteraciones por segundo.
  • Si insecureHttps no esta presente o es false, el comportamiento TLS queda igual que antes.

Extraccion de valores

extract acepta un mapa nombreVariable -> ruta.

{
  "extract": {
    "uploadFileProcessId": "$.uploadFileProcessId",
    "primerDetalle": "$.data[0].id"
  }
}

Rutas soportadas:

  • $.propiedad
  • $.objeto.hijo
  • $.items[0].id
  • $['propiedad-rara']

Las rutas son case-sensitive. Si el response trae uploadFileProcessId, entonces $.UploadFileProcessId va a fallar.

Multipart

Para multipart:

  • define file con la ruta del archivo
  • define filekey exactamente como lo espera el backend
  • manda los campos extra en body
  • no copies manualmente Content-Type: multipart/form-data; boundary=...; el CLI lo genera solo

Ejemplo:

{
  "url": "https://api.example.test/uploads",
  "method": "post",
  "headers": {
    "Authorization": "Bearer {{uuid}}"
  },
  "file": "./foto.jpg",
  "filekey": "File",
  "body": {
    "TypeFile": "1",
    "ReasonProcess": "Carga {{timestamp}}"
  }
}

Metricas generadas

Al finalizar, el CLI imprime un resumen y guarda reporte.txt con:

  • iteraciones totales, exitosas y fallidas
  • requests ejecutados
  • throughput real en iter/s y req/s
  • latencia por iteracion
  • latencia agregada por request
  • metricas por step: ejecutado, exitoso, errores, omitido por cascade, latencia y codigos de estado

Prompt de informe

prix-r9 --prompt

Copia promptInforme.txt al directorio actual. El template ya esta orientado a analizar escenarios multi-step y distinguir entre metricas por iteracion y metricas por step.