{"id":29687279,"url":"https://github.com/thepalaceproject/circulation-load-test","last_synced_at":"2025-07-23T04:36:34.781Z","repository":{"id":104877642,"uuid":"546666389","full_name":"ThePalaceProject/circulation-load-test","owner":"ThePalaceProject","description":"Code to simulate user load against Palace APIs","archived":false,"fork":false,"pushed_at":"2025-03-20T22:03:39.000Z","size":179,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-20T23:22:18.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"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/ThePalaceProject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-06T12:57:03.000Z","updated_at":"2025-03-20T22:03:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"ac2a0c60-3563-41e0-ad46-313d8eec79d7","html_url":"https://github.com/ThePalaceProject/circulation-load-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThePalaceProject/circulation-load-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePalaceProject%2Fcirculation-load-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePalaceProject%2Fcirculation-load-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePalaceProject%2Fcirculation-load-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePalaceProject%2Fcirculation-load-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThePalaceProject","download_url":"https://codeload.github.com/ThePalaceProject/circulation-load-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePalaceProject%2Fcirculation-load-test/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266619012,"owners_count":23957273,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-07-23T04:36:34.090Z","updated_at":"2025-07-23T04:36:34.767Z","avatar_url":"https://github.com/ThePalaceProject.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Palace Backend Load Testing\n\nThis repo contains a set of load tests that can be run against the Palace backend\nto simulate user load on the servers.\n\nPlease read the [fair warning](#fair-warning)!\n\n## Locust\n\nThese tests are built in Python using [Locust](https://locust.io/). The Locust page\ncontains good [documentation](https://docs.locust.io/en/stable/writing-a-locustfile.html)\nabout writing tests.\n\n## Running Load Tests\n\nInstall dependencies:\n\n```shell\npoetry install\n```\n\nWrite a [configuration file](#configuration-file), place its fully-qualified path in\nthe `CIRCULATION_LOAD_CONFIGURATION_FILE` environment variable, and run Locust:\n\n```shell\npoetry run \\\n  env CIRCULATION_LOAD_CONFIGURATION_FILE=$(realpath hosts.json) \\\n  locust\n```\n\nThe locust dashboard will then be available at: `http://localhost:8089`.\n\n## Fair Warning\n\n*Do not run this code against production servers!*\n\n*Some tests involve borrowing books. Borrowing a book, on many CMs, will consume a license. This may cost money!*\n\nA good example is the [bookmark tests](src/circulation_load_test/common/cmsearchbookmark.py); in order to create\nbookmarks, the bookmarks must be associated with a loan. The bookmark test loans a random book, adds a lot of\nbookmarks, and then returns the book.\n\n## Configuration File\n\nThe configuration file specifies the [Library Registry](https://github.com/ThePalaceProject/library-registry)\nand [Circulation Manager](https://github.com/ThePalaceProject/circulation) instances against which tests will\nrun. For the CM, a list of users (along with their passwords) must also be specified. One user must be declared\nas _primary_, as some tests will use this user as the default user for various reasons.\n\nThe configuration file also contains a list of library identifiers that must exist on the target CM. These\nare used by tests that want to try making requests to random libraries.\n\n```json\n{\n  \"registry\": {\n    \"host\": \"http://registry.example.com/\"\n  },\n  \"circulation_manager\": {\n    \"host\": \"http://cm.example.com/\",\n    \"users\": {\n      \"user0\": {\n        \"primary\": \"true\",\n        \"password\": \"abcd1234\"\n      },\n      \"user1\": {\n        \"password\": \"abcd1234\"\n      },\n      \"user2\": {\n        \"password\": \"abcd1234\"\n      }\n    },\n    \"library_identifiers\": [\n      \"Library1\",\n      \"Library2\",\n      \"Library3\"\n    ]\n  }\n}\n```\n\n## Running Unit Tests\n\nUnit tests can be executed using [tox](https://pypi.org/project/tox/). At the time of writing, the only\navailable environment is `py310` (which tests against Python 3.10.*):\n\n```sh\ntox -e py310\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepalaceproject%2Fcirculation-load-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthepalaceproject%2Fcirculation-load-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepalaceproject%2Fcirculation-load-test/lists"}