{"id":13522252,"url":"https://github.com/bojand/ghz","last_synced_at":"2025-05-13T16:07:07.358Z","repository":{"id":38016157,"uuid":"125127188","full_name":"bojand/ghz","owner":"bojand","description":"Simple gRPC benchmarking and load testing tool","archived":false,"fork":false,"pushed_at":"2024-12-05T02:06:12.000Z","size":29684,"stargazers_count":3057,"open_issues_count":90,"forks_count":272,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-12-16T17:05:21.823Z","etag":null,"topics":["grpc","hacktoberfest"],"latest_commit_sha":null,"homepage":"https://ghz.sh","language":"Go","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/bojand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":["https://www.paypal.me/bojandj","https://www.buymeacoffee.com/bojand"]}},"created_at":"2018-03-13T23:23:30.000Z","updated_at":"2024-12-16T14:39:31.000Z","dependencies_parsed_at":"2023-02-17T01:02:20.831Z","dependency_job_id":"75944e32-b2db-482e-9fbb-de27be191d6f","html_url":"https://github.com/bojand/ghz","commit_stats":{"total_commits":757,"total_committers":52,"mean_commits":"14.557692307692308","dds":"0.21003963011889037","last_synced_commit":"539da408b492e9d2d093958b696e02dc2e2504d7"},"previous_names":["bojand/grpcannon"],"tags_count":118,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bojand%2Fghz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bojand%2Fghz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bojand%2Fghz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bojand%2Fghz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bojand","download_url":"https://codeload.github.com/bojand/ghz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250513380,"owners_count":21443200,"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":["grpc","hacktoberfest"],"created_at":"2024-08-01T06:00:44.649Z","updated_at":"2025-04-23T20:45:26.942Z","avatar_url":"https://github.com/bojand.png","language":"Go","funding_links":["https://www.paypal.me/bojandj","https://www.buymeacoffee.com/bojand"],"categories":["Go","4. Load Generators and Synthetic Traffic","Tools","HTTP/HTTPS/gRPC","Performance Testing","Projects"],"sub_categories":["Events \u0026 Problems","Testing","gRPC Tools","gRPC \u0026 Protocol-Specific Testing","API Testing"],"readme":"\u003cdiv align=\"center\"\u003e\n\t\u003cbr\u003e\n\t\u003cimg src=\"green_fwd2.svg\" alt=\"Logo\" width=\"100\"\u003e\n\t\u003cbr\u003e\n\u003c/div\u003e\n\n# ghz\n\n[![Release](https://img.shields.io/github/release/bojand/ghz.svg?style=flat-square)](https://github.com/bojand/ghz/releases/latest)\n![Build Status](https://github.com/bojand/ghz/workflows/build/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bojand/ghz?style=flat-square)](https://goreportcard.com/report/github.com/bojand/ghz)\n[![License](https://img.shields.io/github/license/bojand/ghz.svg?style=flat-square)](https://raw.githubusercontent.com/bojand/ghz/master/LICENSE)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg?style=flat-square)](https://www.paypal.me/bojandj)\n[![Buy me a coffee](https://img.shields.io/badge/buy%20me-a%20coffee-orange.svg?style=flat-square)](https://www.buymeacoffee.com/bojand)\n\n[gRPC](http://grpc.io/) benchmarking and load testing tool.\n\n## Documentation\n\nAll documentation at [ghz.sh](https://ghz.sh).\n\n## Install\n\n### Download\n\n1. Download a prebuilt executable binary for your operating system from the [GitHub releases page](https://github.com/bojand/ghz/releases).\n2. Unzip the archive and place the executable binary wherever you would like to run it from. Additionally consider adding the location directory in the `PATH` variable if you would like the `ghz` command to be available everywhere.\n\n### Homebrew\n\n```sh\nbrew install ghz\n```\n\n### Compile\n\n**Clone**\n\n```sh\ngit clone https://github.com/bojand/ghz\n```\n\n**Build using make**\n\n```sh\nmake build\n```\n\n**Build using go**\n\n```sh\ncd cmd/ghz\ngo build .\n```\n\n**Install using go \u003e= 1.16**\n\n```sh\ngo install github.com/bojand/ghz/cmd/ghz@latest\n```\n\n**Install using Docker**\n\n```sh\nDOCKER_BUILDKIT=1 docker build --output=/usr/local/bin --target=ghz-binary-built https://github.com/bojand/ghz.git\n```\n\n## Usage\n\n```\nusage: ghz [\u003cflags\u003e] [\u003chost\u003e]\n\nFlags:\n  -h, --help                     Show context-sensitive help (also try --help-long and --help-man).\n      --config=                  Path to the JSON or TOML config file that specifies all the test run settings.\n      --proto=                   The Protocol Buffer .proto file.\n      --protoset=                The compiled protoset file. Alternative to proto. -proto takes precedence.\n      --call=                    A fully-qualified method name in 'package.Service/method' or 'package.Service.Method' format.\n  -i, --import-paths=            Comma separated list of proto import paths. The current working directory and the directory of the protocol buffer file are automatically added to the import list.\n      --cacert=                  File containing trusted root certificates for verifying the server.\n      --cert=                    File containing client certificate (public key), to present to the server. Must also provide -key option.\n      --key=                     File containing client private key, to present to the server. Must also provide -cert option.\n      --cname=                   Server name override when validating TLS certificate - useful for self signed certs.\n      --skipTLS                  Skip TLS client verification of the server's certificate chain and host name.\n      --insecure                 Use plaintext and insecure connection.\n      --authority=               Value to be used as the :authority pseudo-header. Only works if -insecure is used.\n      --async                    Make requests asynchronous as soon as possible. Does not wait for request to finish before sending next one.\n  -r, --rps=0                    Requests per second (RPS) rate limit for constant load schedule. Default is no rate limit.\n      --load-schedule=\"const\"    Specifies the load schedule. Options are const, step, or line. Default is const.\n      --load-start=0             Specifies the RPS load start value for step or line schedules.\n      --load-step=0              Specifies the load step value or slope value.\n      --load-end=0               Specifies the load end value for step or line load schedules.\n      --load-step-duration=0     Specifies the load step duration value for step load schedule.\n      --load-max-duration=0      Specifies the max load duration value for step or line load schedule.\n  -c, --concurrency=50           Number of request workers to run concurrently for const concurrency schedule. Default is 50.\n      --concurrency-schedule=\"const\"\n                                 Concurrency change schedule. Options are const, step, or line. Default is const.\n      --concurrency-start=0      Concurrency start value for step and line concurrency schedules.\n      --concurrency-end=0        Concurrency end value for step and line concurrency schedules.\n      --concurrency-step=1       Concurrency step / slope value for step and line concurrency schedules.\n      --concurrency-step-duration=0\n                                 Specifies the concurrency step duration value for step concurrency schedule.\n      --concurrency-max-duration=0\n                                 Specifies the max concurrency adjustment duration value for step or line concurrency schedule.\n  -n, --total=200                Number of requests to run. Default is 200.\n  -t, --timeout=20s              Timeout for each request. Default is 20s, use 0 for infinite.\n  -z, --duration=0               Duration of application to send requests. When duration is reached, application stops and exits. If duration is specified, n is ignored. Examples: -z 10s -z 3m.\n  -x, --max-duration=0           Maximum duration of application to send requests with n setting respected. If duration is reached before n requests are completed, application stops and exits. Examples: -x 10s -x 3m.\n      --duration-stop=\"close\"    Specifies how duration stop is reported. Options are close, wait or ignore. Default is close.\n  -d, --data=                    The call data as stringified JSON. If the value is '@' then the request contents are read from stdin.\n  -D, --data-file=               File path for call data JSON file. Examples: /home/user/file.json or ./file.json.\n  -b, --binary                   The call data comes as serialized binary message or multiple count-prefixed messages read from stdin.\n  -B, --binary-file=             File path for the call data as serialized binary message or multiple count-prefixed messages.\n  -m, --metadata=                Request metadata as stringified JSON.\n  -M, --metadata-file=           File path for call metadata JSON file. Examples: /home/user/metadata.json or ./metadata.json.\n      --stream-interval=0        Interval for stream requests between message sends.\n      --stream-call-duration=0   Duration after which client will close the stream in each streaming call.\n      --stream-call-count=0      Count of messages sent, after which client will close the stream in each streaming call.\n      --stream-dynamic-messages  In streaming calls, regenerate and apply call template data on every message send.\n      --reflect-metadata=        Reflect metadata as stringified JSON used only for reflection request.\n  -o, --output=                  Output path. If none provided stdout is used.\n  -O, --format=                  Output format. One of: summary, csv, json, pretty, html, influx-summary, influx-details. Default is summary.\n      --skipFirst=0              Skip the first X requests when doing the results tally.\n      --count-errors             Count erroneous (non-OK) resoponses in stats calculations.\n      --connections=1            Number of connections to use. Concurrency is distributed evenly among all the connections. Default is 1.\n      --connect-timeout=10s      Connection timeout for the initial connection dial. Default is 10s.\n      --keepalive=0              Keepalive time duration. Only used if present and above 0.\n      --name=                    User specified name for the test.\n      --tags=                    JSON representation of user-defined string tags.\n      --cpus=12                  Number of cpu cores to use.\n      --debug=                   The path to debug log file.\n  -e, --enable-compression       Enable Gzip compression on requests.\n  -v, --version                  Show application version.\n\nArgs:\n  [\u003chost\u003e]  Host and port to test.\n```\n\n## Go Package\n\n```go\nreport, err := runner.Run(\n    \"helloworld.Greeter.SayHello\",\n    \"localhost:50051\",\n    runner.WithProtoFile(\"greeter.proto\", []string{}),\n    runner.WithDataFromFile(\"data.json\"),\n    runner.WithInsecure(true),\n)\n\nif err != nil {\n    fmt.Println(err.Error())\n    os.Exit(1)\n}\n\nprinter := printer.ReportPrinter{\n    Out:    os.Stdout,\n    Report: report,\n}\n\nprinter.Print(\"pretty\")\n```\n\n## Development\n\nGolang 1.11+ is required.\n\n```\nmake # run all linters, tests, and produce code coverage\nmake build # build the binaries\nmake lint # run all linters\nmake test # run tests\nmake cover # run tests and produce code coverage\n\nV=1 make # more verbosity\nOPEN_COVERAGE=1 make cover # open code coverage.html after running\n```\n\n## Credit\n\nIcon made by \u003ca href=\"http://www.freepik.com\" title=\"Freepik\"\u003eFreepik\u003c/a\u003e from \u003ca href=\"https://www.flaticon.com/\" title=\"Flaticon\"\u003ewww.flaticon.com\u003c/a\u003e is licensed by \u003ca href=\"http://creativecommons.org/licenses/by/3.0/\" title=\"Creative Commons BY 3.0\" target=\"_blank\"\u003eCC 3.0 BY\u003c/a\u003e\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbojand%2Fghz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbojand%2Fghz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbojand%2Fghz/lists"}