{"id":18298334,"url":"https://github.com/fusionauth/fusionauth-load-tests","last_synced_at":"2025-04-05T13:33:22.329Z","repository":{"id":42111203,"uuid":"146044413","full_name":"FusionAuth/fusionauth-load-tests","owner":"FusionAuth","description":"FusionAuth load tests","archived":false,"fork":false,"pushed_at":"2024-10-23T16:35:48.000Z","size":301,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":11,"default_branch":"develop","last_synced_at":"2024-10-23T23:11:22.307Z","etag":null,"topics":["load-testing"],"latest_commit_sha":null,"homepage":"https://fusionauth.io","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FusionAuth.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-24T22:11:32.000Z","updated_at":"2024-10-23T16:35:54.000Z","dependencies_parsed_at":"2023-10-11T03:19:07.070Z","dependency_job_id":"a4efa687-26a6-4901-b92e-7a67a1d5169d","html_url":"https://github.com/FusionAuth/fusionauth-load-tests","commit_stats":null,"previous_names":[],"tags_count":174,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-load-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-load-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-load-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-load-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FusionAuth","download_url":"https://codeload.github.com/FusionAuth/fusionauth-load-tests/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223192690,"owners_count":17103564,"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":["load-testing"],"created_at":"2024-11-05T15:05:48.686Z","updated_at":"2024-11-05T15:05:49.292Z","avatar_url":"https://github.com/FusionAuth.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FusionAuth Load Tests ![semver 2.0.0 compliant](http://img.shields.io/badge/semver-2.0.0-brightgreen.svg?style=flat-square)\n\nThis repo contains load tests you can run against any FusionAuth instance.\n\n\n## Setup\n\n### Start FusionAuth\n\nYou will need a working FusionAuth instance. If you want to run load tests, you have probably already figured this part out.\n\n### Configure FusionAuth\n\n#### Create an API Key\n\n1. Go to `https://[your.fusionauth.url]/admin/api-key`.\n1. Click the green + button to create a new API Key.\n1. On the **Add API Key** screen, don't modify or input any values, just click the Save icon.\n1. You should now see your API key. Click on the Key name to reveal the key.\n\n⚠️ If you don't want to create a Super User key, make sure the key at least has permissions to add applications, add users, and log in users, for all tenants.\n\n#### Run the setup script\n\nRun the `setup.sh` script to create the FusionAuth Application required for the load tests.\n\nAll parameters are optional and will default to values used by FusionAuth's internal development team. If you're not on our development team (and maybe even if you are, if you're not running FusionAuth locally, or not using default values) you'll have to pass in at least `--url` and `--key`:\n```\n./setup.sh --url https://[your.fusionauth.url] --key [your-api-key]\n```\n\n⚠️ If your `Default` tenant Id is different from what the script expects, you may get a `400` response code when running the script. In this case, get the Id from your `Default` tenant and pass that in with the `--tenant` flag.\n\nIf the script was successful, you should see a new **FusionAuthLoadTesting** Application in your FusionAuth instance's Admin portal.\n\n\n### Configure Load Tests\n\nThe setup script will configure two common tests for you, [User-Registrations](src/main/resources/User-Registrations.json) and [User-Logins](src/main/resources/User-Logins.json). If you want to run other tests, you'll need to modify them with your authentication data.\n\nCheck the test JSON files in [src/main/resources](src/main/resources). Update each JSON file you want to use with your URL, api key, and tenant Id value as needed.\n\nYou may also wish to adjust the load test run by modifying the `loopCount` and `workerCount` values.\n\nTo test user registrations with less CPU load, you can change the `factor` value in [User-Registrations](src/main/resources/User-Registrations.json). The default of `24000` is meant to mimic an actual user registration. You can turn that down as low as `1` to allow for faster registrations with less CPU load. This can be useful if you need to hit the database hard without being constrained by CPU.\n\n\n### Building the Tests\n\nThe setup script will build the tests for you. However, if you've made changes and need to rebuild, run `sb int`.\n\nYou can also start from scratch and wipe the `build` directory with `sb clean`.\n\nSee [Installing Savant](#installing-savant) below if you do not have Savant installed.\n\n\n## Run a Load Test\n\nBefore you can log users in, you need to create users.\n\n⚠️ **IMPORTANT!** If you have configured SMTP in your Tenant with a valid public SMTP server, performing a user registration test could get you flagged for abuse, and negatively impact your email deliverability. You should remove your SMTP configuration before running the user registration test.\n\nTo create users, run the User-Registrations test:\n```\ncd build/dist\n./load-test.sh User-Registrations.json\n```\n\nNow that you have users, you can run the User-Logins test:\n```\ncd build/dist\n./load-test.sh User-Logins.json\n```\n\n\n## Cleanup\n\nIf your load test created a Tenant, delete the Tenant it created.\n\nIf your load test only created an Application under the Default Tenant, delete the `FusionAuthLoadTesting` Application to delete the users created by this load test.\n\n\n## Hacking\n\nFeel free to review how the test harness is configured using the JSON DSL. You can add more workers, and worker directives if you like. If you make something cool, feel free to submit a PR.\n\nIf you want to dig into the code further, the `FusionAuthWorkerFactory` is what takes a `directive` from the `Foreman` and builds a worker to satisfy the directive.\n\n\n## Installing Savant\n\nThis project uses the [Savant](https://github.com/savant-build/savant-core) build tool.\n\nTo install Savant, follow these instructions:\n```bash\nmkdir ~/savant\ncd ~/savant\nwget http://savant.inversoft.org/org/savantbuild/savant-core/2.0.0/savant-2.0.0.tar.gz\ntar xvfz savant-2.0.0.tar.gz\nln -s ./savant-2.0.0 current\nexport PATH=$PATH:~/savant/current/bin/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffusionauth%2Ffusionauth-load-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffusionauth%2Ffusionauth-load-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffusionauth%2Ffusionauth-load-tests/lists"}