{"id":15692274,"url":"https://github.com/ulisesgascon/poc-load-test","last_synced_at":"2025-05-08T02:24:34.828Z","repository":{"id":45217005,"uuid":"244023225","full_name":"UlisesGascon/PoC-Load-test","owner":"UlisesGascon","description":"Just a simple repo to show the potential of K6.io","archived":false,"fork":false,"pushed_at":"2021-12-30T21:33:11.000Z","size":462,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T11:56:20.685Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UlisesGascon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-29T18:47:24.000Z","updated_at":"2024-09-27T04:29:41.000Z","dependencies_parsed_at":"2022-08-04T12:45:21.413Z","dependency_job_id":null,"html_url":"https://github.com/UlisesGascon/PoC-Load-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UlisesGascon%2FPoC-Load-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UlisesGascon%2FPoC-Load-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UlisesGascon%2FPoC-Load-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UlisesGascon%2FPoC-Load-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UlisesGascon","download_url":"https://codeload.github.com/UlisesGascon/PoC-Load-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252985259,"owners_count":21835946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T18:30:29.443Z","updated_at":"2025-05-08T02:24:34.794Z","avatar_url":"https://github.com/UlisesGascon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# POC: Load tests against API Rest\n\n## Objective\n\nThis project will handle the load tests for backend API.\n\nInclude:\n- Regular request (`load_scripts/backend-api/manifest.js`)\n- Login simple request (`load_scripts/backend-api/login.js`)\n- JWT Request (including token request) (`load_scripts/backend-api/checkToken.js`)\n- Random payload generated requests (using Faker.js) (`load_scripts/backend-api/register.js`)\n\n## Targets\n\n### Terminal support\n\nThe scripts provide a simplified visual report with testings and validations\n\n![terminal demo](others/terminal.png)\n\n### Grafana Dashboard support\n\nThere is an easy option to debug any performance issue using a full featured dashboard.\n\n![dashboard demo](others/dashboard.png)\n\n#### Advance details\n\nAs well is possible to check details in depth.\n\n![details demo](others/details.png)\n\n## Usage\n\n### Infrastructure\n\n```bash\nnpm run infra:build   # Build docker-compose\nnpm run infra:start   # Up docker-compose\nnpm run infra:stop    # Down docker-compose\n```\n\n## Preparation\n\n### Handle secrets\n\nYou should create a `.env` file at the same level as the `docker-compose.yml`. Those environmental variables will be injected to the K6 docker image.\n\nVariables needed:\n\n```text\nBACKEND_BASE_URL\nUSER_EMAIL\nUSER_PASS\n```\n\n## Run the tests\n\n### Start the environment\n\n```bash\nnpm run infra:start\n```\n\n### Handle Dashboard\n\nBy default there is no dashboard attached to Grafana. So please follow the steps.\n\n1. Enter to import dashboard: http://localhost:3000/dashboard/import\n2. Add `2587` to `Grafana.com Dashboard` and click `Load``\n3. On the new screen select `myfluxdb` as the value for `k6` field and click `import`\n4. You will redirected to the dashboard\n\n### Execute the tests\n\nUpdate the `.env` with the information needed.\n\nNote: If you need to access to a running server outside the container, you can use `host.docker.internal`, like:\n\n```\nBACKEND_BASE_URL=http://host.docker.internal:4000\n```\n\n\nTo run the tests:\n\n```bash\nnpm run load-test:run\n```\n\n:warning: Note: the tests can take a while 5 minutes or more. So please check the terminal and the dashboard\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulisesgascon%2Fpoc-load-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulisesgascon%2Fpoc-load-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulisesgascon%2Fpoc-load-test/lists"}