{"id":37132219,"url":"https://github.com/therenotomorrow/pusher","last_synced_at":"2026-01-14T15:25:46.611Z","repository":{"id":320886329,"uuid":"1077718250","full_name":"therenotomorrow/pusher","owner":"therenotomorrow","description":"Simple and quick load testing for Go code.","archived":false,"fork":false,"pushed_at":"2025-10-26T13:51:10.000Z","size":72,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-26T15:35:28.727Z","etag":null,"topics":["go","golang","testing","toolkit"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/therenotomorrow/pusher","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/therenotomorrow.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-16T16:29:51.000Z","updated_at":"2025-10-26T14:02:32.000Z","dependencies_parsed_at":"2025-10-26T15:35:39.016Z","dependency_job_id":null,"html_url":"https://github.com/therenotomorrow/pusher","commit_stats":null,"previous_names":["therenotomorrow/pusher"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/therenotomorrow/pusher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therenotomorrow%2Fpusher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therenotomorrow%2Fpusher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therenotomorrow%2Fpusher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therenotomorrow%2Fpusher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/therenotomorrow","download_url":"https://codeload.github.com/therenotomorrow/pusher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therenotomorrow%2Fpusher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28424374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","golang","testing","toolkit"],"created_at":"2026-01-14T15:25:46.090Z","updated_at":"2026-01-14T15:25:46.602Z","avatar_url":"https://github.com/therenotomorrow.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pusher\n\n\u003cdiv\u003e\n  \u003ca href=\"https://github.com/therenotomorrow/pusher/releases\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/release/therenotomorrow/pusher?color=FBC02D\" alt=\"GitHub releases\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://go.dev/doc/go1.25\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Go-%3E%3D%201.25-blue.svg\" alt=\"Go 1.25\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/therenotomorrow/pusher\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://godoc.org/github.com/therenotomorrow/pusher?status.svg\" alt=\"Go reference\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/therenotomorrow/pusher/blob/master/LICENSE\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/therenotomorrow/pusher?color=388E3C\" alt=\"License\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/therenotomorrow/pusher/actions/workflows/ci.yml\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/therenotomorrow/pusher/actions/workflows/ci.yml/badge.svg\" alt=\"ci status\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/therenotomorrow/pusher\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://goreportcard.com/badge/github.com/therenotomorrow/pusher\" alt=\"Go report\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/therenotomorrow/pusher\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/codecov/c/github/therenotomorrow/pusher?color=546E7A\" alt=\"Codecov\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n**pusher** is a Go library for simple and quick load testing, see more in the [examples](./examples) folder.\n\nThe library is built around the **Worker** concept — the entity who works! Key elements:\n\n- **Worker** — the main character\n- **Target** — what we want to test\n- **Gossiper** — interface for listening to something interesting\n- **Gossip** — task lifecycle events\n- **Offer** — options for hire the **Worker**\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/therenotomorrow/pusher\"\n)\n\nfunc main() {\n\ttarget := func(_ context.Context) (pusher.Result, error) {\n\t\treturn time.Now(), nil // time.Time support pusher.Result interface\n\t}\n\n\t// run target with 50 RPS for 1 minute\n\t_ = pusher.Work(50, time.Minute, target)\n}\n```\n\n## Slow Start\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/therenotomorrow/pusher\"\n)\n\nfunc main() {\n\t// Your function to test\n\ttarget := func(ctx context.Context) (pusher.Result, error) {\n\t\tselect {\n\t\tcase \u003c-ctx.Done():\n\t\t\treturn nil, ctx.Err()\n\t\tdefault:\n\t\t}\n\n\t\tnow := time.Now().UTC()\n\t\tif now.Second()%2 == 0 {\n\t\t\ttime.Sleep(100 * time.Millisecond)\n\t\t}\n\n\t\treturn Result(now.String()), nil\n\t}\n\n\t// Some of your gossips listeners\n\tobservers := make([]*Observer, 0)\n\n\tgossipers := make([]pusher.Gossiper, 0)\n\tfor _, when := range []pusher.When{pusher.Canceled, pusher.BeforeTarget, pusher.AfterTarget} {\n\t\tobserver := \u0026Observer{done: make(chan struct{}), when: when, count: 0}\n\n\t\tobservers = append(observers, observer)\n\t\tgossipers = append(gossipers, observer)\n\t}\n\n\t// run target with 100 RPS for 1 minute with max 10 requests concurrent\n\t// and add 3 listeners for collect statistics\n\terr := pusher.Work(\n\t\t100,                              // rps\n\t\ttime.Minute,                      // duration\n\t\ttarget,                           // target\n\t\tpusher.WithOvertime(10),          // concurrent limit\n\t\tpusher.WithGossips(gossipers...), // our gossipers\n\t)\n\n\t// check what was done and collect\n\tfmt.Println(\"We're done with error:\", err)\n\tfmt.Println(\"Canceled:\", observers[0].count)\n\tfmt.Println(\"Received:\", observers[1].count)\n\tfmt.Println(\"Processed:\", observers[2].count)\n\n\t// Output:\n\t// We're done with error: context deadline exceeded\n\t// Canceled: 256\n\t// Received: 5744\n\t// Processed: 5744\n}\n\ntype Result string\n\nfunc (r Result) String() string {\n\treturn string(r)\n}\n\ntype Observer struct {\n\tdone  chan struct{}\n\twhen  pusher.When\n\tcount int\n}\n\nfunc (o *Observer) Listen(_ context.Context, _ *pusher.Worker, gossips \u003c-chan *pusher.Gossip) {\n\tdefer close(o.done)\n\n\tfor gossip := range gossips {\n\t\tif gossip.When == o.when {\n\t\t\to.count++\n\t\t}\n\t}\n}\n\nfunc (o *Observer) Stop() {\n\t\u003c-o.done\n}\n```\n\n## Development\n\n### System Requirements\n\n```shell\ngo version\n# go version go1.25.2 or higher\n\njust --version\n# just 1.42.4 or higher (https://just.systems/)\n```\n\n### Download sources\n\n```shell\nPROJECT_ROOT=pusher\ngit clone https://github.com/therenotomorrow/pusher.git \"$PROJECT_ROOT\"\ncd \"$PROJECT_ROOT\"\n```\n\n### Setup dependencies\n\n```shell\n# install dependencies\ngo mod tidy\n\n# check code integrity\njust code test # see other recipes by calling `just`\n\n# setup safe development (optional)\ngit config --local core.hooksPath .githooks\n```\n\n### Project Structure\n\n```\npusher/\n├── config.go   # Configuration and functional options\n├── errors.go   # Error definitions\n├── gossip.go   # Event system and telemetry\n├── pusher.go   # Main API and high-level functions\n└── worker.go   # Worker implementation and execution logic\n```\n\n### Testing\n\n```shell\n# run quick checks\njust test smoke # or just test\n\n# run with coverage\njust test cover\n```\n\n## License\n\nMIT License. See the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftherenotomorrow%2Fpusher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftherenotomorrow%2Fpusher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftherenotomorrow%2Fpusher/lists"}