{"id":25911418,"url":"https://github.com/copyleftdev/har-pilot","last_synced_at":"2025-03-03T09:17:29.279Z","repository":{"id":249705214,"uuid":"832325922","full_name":"copyleftdev/har-pilot","owner":"copyleftdev","description":"is a powerful tool designed to run HAR (HTTP Archive) files and perform load testing using these files.","archived":false,"fork":false,"pushed_at":"2024-07-23T19:33:01.000Z","size":10294,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-24T22:32:16.778Z","etag":null,"topics":["aws","aws-s3","cli","load-testing","qa-automation","qa-automation-test","rust","test-automation"],"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/copyleftdev.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":"2024-07-22T19:43:59.000Z","updated_at":"2024-07-23T19:39:00.000Z","dependencies_parsed_at":"2024-07-22T22:13:53.663Z","dependency_job_id":null,"html_url":"https://github.com/copyleftdev/har-pilot","commit_stats":null,"previous_names":["copyleftdev/har-pilot"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copyleftdev%2Fhar-pilot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copyleftdev%2Fhar-pilot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copyleftdev%2Fhar-pilot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copyleftdev%2Fhar-pilot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/copyleftdev","download_url":"https://codeload.github.com/copyleftdev/har-pilot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241637273,"owners_count":19994946,"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":["aws","aws-s3","cli","load-testing","qa-automation","qa-automation-test","rust","test-automation"],"created_at":"2025-03-03T09:17:28.676Z","updated_at":"2025-03-03T09:17:29.266Z","avatar_url":"https://github.com/copyleftdev.png","language":"Rust","readme":"# har-pilot\n\n![har-pilot Logo](./logo.png)\n\n**har-pilot** is a powerful tool designed to run HAR (HTTP Archive) files and perform load testing using these files.\n\n## What is a HAR File?\n\nA HAR (HTTP Archive) file is a JSON-formatted archive file format that contains a record of web requests and responses. HAR files are typically generated by web browsers' developer tools and capture detailed information about network interactions.\n\n### Values and History\n\nThe HAR file format was developed to facilitate the export and analysis of HTTP communication sessions. Initially, it was mainly used for debugging and performance analysis by web developers. Over time, it gained widespread adoption due to its ability to provide a comprehensive view of web transactions.\n\n### RFC Details\n\nAlthough HAR does not have an official RFC, it has become a de facto standard for HTTP session recording. The format was primarily influenced by the Web Performance Working Group at the W3C, which sought to create a unified format for logging network requests and responses.\n\n### Adoption\n\nHAR files are widely supported by major web browsers, including Chrome, Firefox, and Edge. Developer tools in these browsers can export network activity as HAR files, making them accessible for various performance analysis and debugging tools.\n\n## Benefits of Using HAR Files\n\n- **Debugging and Performance Analysis:** HAR files help developers debug network issues and analyze the performance of web applications.\n- **Load Testing:** By replaying HAR files, developers can simulate real user interactions and test how their application performs under load.\n- **Detailed Metrics:** HAR files provide detailed metrics about each request and response, including headers, cookies, request timings, and more.\n\n## Features of har-pilot\n\n- **Run HAR Files:** Execute HTTP requests captured in HAR files.\n- **Load Testing:** Perform load testing by running HAR files multiple times.\n- **Detailed Metrics:** Collect and store metrics such as response time, status codes, and response bodies in a SQLite database.\n- **Concurrency:** Handle multiple requests concurrently for efficient load testing.\n- **Progress Tracking:** Track progress with a detailed progress bar.\n- **S3 Upload:** Optionally upload the results to an S3 bucket for storage and further analysis.\n\n## How har-pilot Pairs with Testing Realistic User Workflows\n\nhar-pilot is designed to help developers test their applications under realistic conditions. By replaying HAR files, which capture actual user interactions with a web application, har-pilot can simulate real-world usage patterns. This allows developers to identify performance bottlenecks, assess the impact of concurrent requests, and ensure their applications can handle the expected load.\n\n## Installation\n\nTo get started with `har-pilot`, clone the repository and install the dependencies:\n\n```sh\ngit clone https://github.com/copyleftdev/har-pilot.git\ncd har-pilot\ncargo build\n```\n\n## Usage\n\n### Running HAR Files\n\nTo run a HAR file and execute the HTTP requests contained within it, use the following command:\n\n```sh\ncargo run -- \u003cpath-to-har-file\u003e --itercount \u003cnumber-of-iterations\u003e [--s3-bucket \u003cbucket-name\u003e]\n```\n\n- `\u003cpath-to-har-file\u003e`: The path to the HAR file you want to run.\n- `\u003cnumber-of-iterations\u003e`: The number of times to run the HAR file for load testing.\n- `[--s3-bucket \u003cbucket-name\u003e]`: (Optional) The name of the S3 bucket to upload the results to.\n\nFor example:\n\n```sh\n# Running without S3 upload\ncargo run -- example.har --itercount 5\n\n# Running with S3 upload\ncargo run -- example.har --itercount 5 --s3-bucket your-s3-bucket-name\n```\n\n### Storing Metrics\n\n`har-pilot` stores detailed metrics of each request in a SQLite database. The database file is named with a unique identifier to ensure no conflicts:\n\n- **URL**: The URL of the request.\n- **Method**: The HTTP method used (e.g., GET, POST).\n- **Response**: The response body.\n- **Status**: The HTTP status code.\n- **Timestamp**: The timestamp when the request was made.\n- **Duration**: The response time in milliseconds.\n\n### Querying Metrics\n\nYou can query the SQLite database to analyze the metrics collected during the load testing. Here are some useful queries:\n\n#### Average Response Time Per Second\n\n```sql\nSELECT \n    strftime('%Y-%m-%d %H:%M:%S', timestamp) as second,\n    AVG(duration_ms) as avg_response_time_ms\nFROM \n    metrics\nGROUP BY \n    strftime('%Y-%m-%d %H:%M:%S', timestamp)\nORDER BY \n    second;\n```\n\n#### Total Requests Per Second\n\n```sql\nSELECT \n    strftime('%Y-%m-%d %H:%M:%S', timestamp) as second,\n    COUNT(*) as total_requests\nFROM \n    metrics\nGROUP BY \n    strftime('%Y-%m-%d %H:%M:%S', timestamp)\nORDER BY \n    second;\n```\n\n#### Combined Query for Both Average Response Time and Total Requests\n\n```sql\nSELECT \n    strftime('%Y-%m-%d %H:%M:%S', timestamp) as second,\n    COUNT(*) as total_requests,\n    AVG(duration_ms) as avg_response_time_ms\nFROM \n    metrics\nGROUP BY \n    strftime('%Y-%m-%d %H:%M:%S', timestamp)\nORDER BY \n    second;\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcopyleftdev%2Fhar-pilot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcopyleftdev%2Fhar-pilot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcopyleftdev%2Fhar-pilot/lists"}