{"id":19201286,"url":"https://github.com/tylertreat/bench","last_synced_at":"2025-04-09T16:20:12.315Z","repository":{"id":57491575,"uuid":"48312474","full_name":"tylertreat/bench","owner":"tylertreat","description":"A generic latency benchmarking library.","archived":false,"fork":false,"pushed_at":"2017-09-11T23:37:26.000Z","size":144,"stargazers_count":313,"open_issues_count":5,"forks_count":25,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-02T10:52:47.058Z","etag":null,"topics":["benchmark","hdrhistogram","latency","latency-distribution"],"latest_commit_sha":null,"homepage":"","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/tylertreat.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}},"created_at":"2015-12-20T08:18:50.000Z","updated_at":"2025-03-23T06:41:32.000Z","dependencies_parsed_at":"2022-08-31T04:41:37.560Z","dependency_job_id":null,"html_url":"https://github.com/tylertreat/bench","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/tylertreat%2Fbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylertreat%2Fbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylertreat%2Fbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylertreat%2Fbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tylertreat","download_url":"https://codeload.github.com/tylertreat/bench/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065281,"owners_count":21041872,"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":["benchmark","hdrhistogram","latency","latency-distribution"],"created_at":"2024-11-09T12:37:41.002Z","updated_at":"2025-04-09T16:20:12.283Z","avatar_url":"https://github.com/tylertreat.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bench [![GoDoc](https://godoc.org/github.com/tylertreat/bench?status.svg)](https://godoc.org/github.com/tylertreat/bench)\n\nBench is a generic latency benchmarking library. It's generic in the sense that it exposes a simple interface (`Requester`) which can be implemented for various systems under test. Several [example Requesters](https://github.com/tylertreat/bench/tree/master/requester) are provided out of the box.\n\nBench works by attempting to issue a fixed rate of requests per second and measuring the latency of each request issued synchronously. Latencies are captured using [HDR Histogram](https://github.com/codahale/hdrhistogram), which observes the complete latency distribution and attempts to correct for [Coordinated Omission](https://groups.google.com/forum/#!msg/mechanical-sympathy/icNZJejUHfE/BfDekfBEs_sJ). It provides facilities to generate output which can be [plotted](http://hdrhistogram.github.io/HdrHistogram/plotFiles.html) to produce graphs like the following:\n\n![Latency Distribution](distribution.png)\n\n## Example Benchmark\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/tylertreat/bench\"\n\t\"github.com/tylertreat/bench/requester\"\n)\n\nfunc main() {\n\tr := \u0026requester.RedisPubSubRequesterFactory{\n\t\tURL:         \":6379\",\n\t\tPayloadSize: 500,\n\t\tChannel:     \"benchmark\",\n\t}\n\n\tbenchmark := bench.NewBenchmark(r, 10000, 1, 30*time.Second, 0)\n\tsummary, err := benchmark.Run()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(summary)\n\tsummary.GenerateLatencyDistribution(nil, \"redis.txt\")\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylertreat%2Fbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftylertreat%2Fbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylertreat%2Fbench/lists"}