{"id":18290741,"url":"https://github.com/nikouu/one-class-load-tester","last_synced_at":"2025-04-09T07:33:57.559Z","repository":{"id":118557844,"uuid":"590740034","full_name":"nikouu/One-Class-Load-Tester","owner":"nikouu","description":"🏋️‍♂️ A really simple few lines of code to get a dirty load tester going. 🏋️‍♀️","archived":false,"fork":false,"pushed_at":"2023-01-20T03:20:30.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T08:08:51.689Z","etag":null,"topics":["csharp","load-test","load-testing"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikouu.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-19T04:46:28.000Z","updated_at":"2023-01-19T08:58:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"bd05479d-c721-4aaf-90d3-eec40da67019","html_url":"https://github.com/nikouu/One-Class-Load-Tester","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/nikouu%2FOne-Class-Load-Tester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikouu%2FOne-Class-Load-Tester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikouu%2FOne-Class-Load-Tester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikouu%2FOne-Class-Load-Tester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikouu","download_url":"https://codeload.github.com/nikouu/One-Class-Load-Tester/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247997863,"owners_count":21030694,"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":["csharp","load-test","load-testing"],"created_at":"2024-11-05T14:12:00.464Z","updated_at":"2025-04-09T07:33:57.542Z","avatar_url":"https://github.com/nikouu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# One Class Load Tester 💪\n\nA really simple few lines of code to get a dirty load tester going. So easy in fact, it's a single class that could **just be copied over**. Meaning if you are unable to clone, or download an .exe, the copying is super simple.\n\n\n![](images/YouHaveHeardOfMe.jpg)\n\n\n## Where did this come from?\nI needed a really quick and dirty load tester and I wasn't in a position to clone or download projects/libraries/software... So this thing was created 💀\n\n## How does it work?\n\nAll the magic is in `LoadTestEngine.cs`.\n\nThe core concept is the \"test group\" and inside each group is each bunch of requests you're looking to fire at once. Plus a test group has what value of delay to wait before the next bunch of requests. For example, let's say you wanted to do 5 requests every 2 seconds. This is two test groups with five tasks in each, with the delay set to 2000ms. \n\nSee the example below for a more clear picture.\n\n### public record TestGroup(List\u003cTask\u003e TestTasks, int PostTestDelay)\n\n```csharp\npublic record TestGroup(List\u003cTask\u003e TestTasks, int PostTestDelay);\n```\n\nWhere:\n| Parameter       | Usage                                                                          |\n| --------------- | ------------------------------------------------------------------------------ |\n| `TestTasks`     | All the request to be made per test group. A list of normal C# `Task` objects. |\n| `PostTestDelay` | The delay in milliseconds before the next test group.                          |\n\n\nNote: The final delay actually doesn't matter as the code will end after the delay value. \n\n## Test Server\n\nWith this solution is a test server which is a simple minimal API project to help goes along with the default load testing project. Run both at the same time to see the console fill with requests.\n\n## What about tokens, query strings, tokens, mTLS certificates?\n\nWith the raw `HttpClient` object sitting there, you should be able to quickly attach anything else you need in the same way you probably have done it in your normal project.\n\nWith limitations of `HttpClient` around things like headers, you may want to create an `HttpClient` object as per what you need and add it to `TestGroup` or create an object to represent TestTasks which has the `Task` and anything else you need to run your test for each run. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikouu%2Fone-class-load-tester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikouu%2Fone-class-load-tester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikouu%2Fone-class-load-tester/lists"}