{"id":19349412,"url":"https://github.com/sazid/lorust","last_synced_at":"2025-02-24T10:19:23.940Z","repository":{"id":176094208,"uuid":"649200944","full_name":"sazid/lorust","owner":"sazid","description":"Load generator Rust","archived":false,"fork":false,"pushed_at":"2024-12-10T07:55:42.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T21:34:23.524Z","etag":null,"topics":["http","http-client","load","load-generator","load-test","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sazid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-06-04T05:30:21.000Z","updated_at":"2024-12-10T07:55:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"1204fe03-2b3b-4606-b0a8-e5a474684a64","html_url":"https://github.com/sazid/lorust","commit_stats":null,"previous_names":["sazid/lorust"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sazid%2Florust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sazid%2Florust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sazid%2Florust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sazid%2Florust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sazid","download_url":"https://codeload.github.com/sazid/lorust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240457988,"owners_count":19804489,"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":["http","http-client","load","load-generator","load-test","rust"],"created_at":"2024-11-10T04:26:10.281Z","updated_at":"2025-02-24T10:19:23.915Z","avatar_url":"https://github.com/sazid.png","language":"Rust","readme":"# lorust\n\n\u003e \u003cu\u003e**lo**\u003c/u\u003ead generator \u003cu\u003e**rust**\u003c/u\u003e\n\nA load generator tool written in Rust. Currently supports\nhttp api calls and custom scripting support with Rhai.\n\n## Build\n\n```sh\n$ cargo build --release\n$ target/release/lorust --help\n```\n\n## Usage\n\n**Note**: The API to the outside world has not been determined yet.\nCurrently, only json based config is supported but this may also\nchange to support other config formats such as TOML, etc. depending\non whether they'll be able to meet the needs and make the config\nmore human readable.\n\nExample `HttpRequest`\n\n```json\n{\n    \"HttpRequest\": {\n        \"method\": \"POST\",\n        \"url\": \"https://reqres.in/api/users?page=1\",\n        \"headers\": [\n            [\"Content-Type\", \"application/json\"],\n            [\"X-ACCESS-TOKEN\", \"32808ft6-21e4-4gh0-8dad-2348987838\"]\n        ],\n        \"body\": \"...\",\n        \"redirect_limit\": 5,\n        \"timeout\": 300\n    }\n}\n```\n\nExample config (this will likely change):\n\n```json\n{\n    \"functions\": [\n        {\n            \"LoadGen\": {\n                \"spawn_rate\": \"1\",\n                \"timeout\": 1,\n                \"functions_to_execute\": [\n                    {\n                        \"HttpRequest\": {\n                            \"url\": \"https://reqres.in/api/users?page=1\",\n                            \"timeout\": 300\n                        }\n                    },\n                    {\n                        \"RunRhaiCode\": {\n                            \"code\": \"let user_id = http_response[\\\"data\\\"].sample().id;\"\n                        }\n                    },\n                    {\n                        \"RunRhaiCode\": {\n                            \"code\": \"print(\\\"Picked user_id: \\\" + user_id);\"\n                        }\n                    },\n                    {\n                        \"HttpRequest\": {\n                            \"url\": \"https://reqres.in/api/users/%|user_id|%\",\n                            \"timeout\": 300\n                        }\n                    },\n                    {\n                        \"RunRhaiCode\": {\n                            \"code\": \"let data = http_response.data; print(data.first_name + \\\" \\\" + data.last_name);\"\n                        }\n                    }\n                ]\n            }\n        }\n    ]\n}\n```\n\nThe above config gives the following output:\n\n```\n--- Running function #1 ---\nRunning load generator with the config:\nLoadGenParam { spawn_rate: \"1\", timeout: 1, max_tasks: None, functions_to_execute: [] }\n=== TICK #1, TASK COUNT: 1 ===\n=== TICK #2, TASK COUNT: 1 ===\nPicked user_id: 3\nEmma Wong\nPicked user_id: 4\nEve Holt\nLoad test complete.\nTOTAL TASKS: 2\nPASSED: 2\nFAILED: 0\nCollected metrics array size: 4\nPrinting first 3 entries\n```\n\n```json\n[\n    {\n        \"url\": \"https://reqres.in/api/users?page=1\",\n        \"http_verb\": \"GET\",\n        \"status_code\": 200,\n        \"response_body_size\": 996,\n        \"time_stamp\": \"2023-06-17 18:41:47.572695000\",\n        \"response_body\": \"\",\n        \"upload_total\": 0,\n        \"download_total\": 368,\n        \"upload_speed\": 0.0,\n        \"download_speed\": 339.0,\n        \"namelookup_time\": {\n            \"secs\": 1,\n            \"nanos\": 27096000\n        },\n        \"connect_time\": {\n            \"secs\": 0,\n            \"nanos\": 6369000\n        },\n        \"tls_handshake_time\": {\n            \"secs\": 0,\n            \"nanos\": 35801000\n        },\n        \"starttransfer_time\": {\n            \"secs\": 1,\n            \"nanos\": 83679000\n        },\n        \"elapsed_time\": {\n            \"secs\": 1,\n            \"nanos\": 83827000\n        },\n        \"redirect_time\": {\n            \"secs\": 0,\n            \"nanos\": 0\n        }\n    },\n    {\n        \"url\": \"https://reqres.in/api/users/3\",\n        \"http_verb\": \"GET\",\n        \"status_code\": 200,\n        \"response_body_size\": 274,\n        \"time_stamp\": \"2023-06-17 18:41:48.660536000\",\n        \"response_body\": \"\",\n        \"upload_total\": 0,\n        \"download_total\": 208,\n        \"upload_speed\": 0.0,\n        \"download_speed\": 7407.0,\n        \"namelookup_time\": {\n            \"secs\": 0,\n            \"nanos\": 1638000\n        },\n        \"connect_time\": {\n            \"secs\": 0,\n            \"nanos\": 5441000\n        },\n        \"tls_handshake_time\": {\n            \"secs\": 0,\n            \"nanos\": 8274000\n        },\n        \"starttransfer_time\": {\n            \"secs\": 0,\n            \"nanos\": 27956000\n        },\n        \"elapsed_time\": {\n            \"secs\": 0,\n            \"nanos\": 28080000\n        },\n        \"redirect_time\": {\n            \"secs\": 0,\n            \"nanos\": 0\n        }\n    },\n    {\n        \"url\": \"https://reqres.in/api/users?page=1\",\n        \"http_verb\": \"GET\",\n        \"status_code\": 200,\n        \"response_body_size\": 996,\n        \"time_stamp\": \"2023-06-17 18:41:48.572680000\",\n        \"response_body\": \"\",\n        \"upload_total\": 0,\n        \"download_total\": 368,\n        \"upload_speed\": 0.0,\n        \"download_speed\": 344.0,\n        \"namelookup_time\": {\n            \"secs\": 0,\n            \"nanos\": 27449000\n        },\n        \"connect_time\": {\n            \"secs\": 1,\n            \"nanos\": 15540000\n        },\n        \"tls_handshake_time\": {\n            \"secs\": 0,\n            \"nanos\": 9175000\n        },\n        \"starttransfer_time\": {\n            \"secs\": 1,\n            \"nanos\": 67105000\n        },\n        \"elapsed_time\": {\n            \"secs\": 1,\n            \"nanos\": 67367000\n        },\n        \"redirect_time\": {\n            \"secs\": 0,\n            \"nanos\": 0\n        }\n    }\n]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsazid%2Florust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsazid%2Florust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsazid%2Florust/lists"}