{"id":15903075,"url":"https://github.com/erikh/go-makeload","last_synced_at":"2025-07-11T02:33:30.263Z","repository":{"id":104249324,"uuid":"608661828","full_name":"erikh/go-makeload","owner":"erikh","description":"Golang library for generating lots of connections accurately (for testing)","archived":false,"fork":false,"pushed_at":"2023-09-20T07:41:39.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T20:14:57.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/erikh.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-03-02T13:39:15.000Z","updated_at":"2023-03-02T13:40:25.000Z","dependencies_parsed_at":"2024-02-06T03:15:46.098Z","dependency_job_id":null,"html_url":"https://github.com/erikh/go-makeload","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"e86f327a443d0ff75bc70ae22a216af8d3699eea"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/erikh/go-makeload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikh%2Fgo-makeload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikh%2Fgo-makeload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikh%2Fgo-makeload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikh%2Fgo-makeload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erikh","download_url":"https://codeload.github.com/erikh/go-makeload/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikh%2Fgo-makeload/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264713002,"owners_count":23652701,"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":[],"created_at":"2024-10-06T12:00:53.459Z","updated_at":"2025-07-11T02:33:30.035Z","avatar_url":"https://github.com/erikh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## makeload: a small library to make HTTP load\n\nThis library is a HTTP load generator, similar in function to `wrk` or `ab`. It\nhas a programmable interface, and is intended for use in integration testing of\na HTTP service. It has a very small statistics collector, an interface for\ndelivering requests, and concurrency and connection controls. It is currently\nvery focused on lean functionality and accuracy. The library has reliably\ntested to deliver the exact amount of requests you deliver it, saturating the\nexact number of cores fitting the concurrency mark.\n\nIt has benchmarking and load generation functions. See the library\ndocumentation for more.\n\n### Usage\n\n`makeload` is a library, which you can use by incorporating the library with\n`go get` and then using the code to drive it. Here is an example from the test\nsuite:\n\n```go\npackage makeload\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"go.uber.org/goleak\"\n)\n\ntype Server struct{}\n\nfunc (s *Server) ServeHTTP(http.ResponseWriter, *http.Request) {}\n\nfunc createServer(t *testing.T) (net.Listener, *http.Server, *url.URL) {\n\tsrv := \u0026Server{}\n\tl, err := net.Listen(\"tcp\", \":0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\thttpSrv := \u0026http.Server{\n\t\tHandler: srv,\n\t}\n\n\tgo httpSrv.Serve(l)\n\n\tu, err := url.Parse(\"http://\" + l.Addr().String())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\treturn l, httpSrv, u\n}\n\nfunc TestLoadGenerator(t *testing.T) {\n\tdefer goleak.VerifyNone(t)\n\n\t// don't annoy the tester, but allow the test to finish for large core counts.\n\tctx, cancel := context.WithTimeout(context.Background(), time.Duration(runtime.NumCPU()*20)*time.Second)\n\tdefer cancel()\n\n\tl, httpSrv, u := createServer(t)\n\tdefer httpSrv.Shutdown(context.Background())\n\tdefer l.Close()\n\n\tlg := NewLoadGenerator(\n\t\tNewBatteryProperties(\n\t\t\tctx,\n\t\t\tuint64(runtime.NumCPU()/2),    // give room for the server to work\n\t\t\tuint64(runtime.NumCPU()*1000), // a very conservative value for modern processors\n\t\t\tu,\n\t\t),\n\t\tuint64(runtime.NumCPU()*100000), // roughly spoken, 100k conns * cpu count for the battery\n\t)\n\n\tif err := lg.Spawn(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tt.Log(\"total delivered: \" + fmt.Sprintf(\"%d\", lg.Properties.Stats().Successes()+lg.Properties.Stats().Failures()))\n\tt.Log(\"successes: \" + fmt.Sprintf(\"%d\", lg.Properties.Stats().Successes()))\n\tt.Log(\"failures: \" + fmt.Sprintf(\"%d\", lg.Properties.Stats().Failures()))\n}\n\n```\n\nUpon running this test with `go test -v`, you would see output like:\n\n```\n=== RUN   TestLoadGenerator\n    makeload_test.go:49: total delivered: 800000\n    makeload_test.go:50: successes: 798799\n    makeload_test.go:51: failures: 1201\n--- PASS: TestLoadGenerator (38.34s)\nPASS\n```\n\n### The future\n\nAs mentioned, more is to come with regards to this library's functionality.\nHere are some things that will probably show up eventually:\n\n-   [ ] Statistics for mean delivery time\n-   [ ] Programmable functionality for determining errors / valid responses\n        (right now just non-200's are errors)\n-   [ ] Programmable request delivery\n-   [ ] Some more self-testing\n\nAs mentioned, I'm shipping this to be a part of another product. If you file\nbugs for it, I will attempt to service requests, but if they conflict with the\nother project's goals, I strongly suggest you fork this library instead of push\nharder for your changes, which is MIT licensed for a reason.\n\nMay peace be with you.\n\n### Author\n\nErik Hollensbe \u003cerik+github@hollensbe.org\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikh%2Fgo-makeload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferikh%2Fgo-makeload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikh%2Fgo-makeload/lists"}