{"id":19988853,"url":"https://github.com/limscoder/grpc-athrottle","last_synced_at":"2026-04-19T15:32:22.622Z","repository":{"id":57571891,"uuid":"151961360","full_name":"limscoder/grpc-athrottle","owner":"limscoder","description":"Adaptive throttling for golang gRPC clients","archived":false,"fork":false,"pushed_at":"2018-10-15T16:43:50.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T11:49:14.759Z","etag":null,"topics":[],"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/limscoder.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":"2018-10-07T16:30:10.000Z","updated_at":"2018-11-06T01:10:59.000Z","dependencies_parsed_at":"2022-08-23T22:21:24.508Z","dependency_job_id":null,"html_url":"https://github.com/limscoder/grpc-athrottle","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/limscoder%2Fgrpc-athrottle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limscoder%2Fgrpc-athrottle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limscoder%2Fgrpc-athrottle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limscoder%2Fgrpc-athrottle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/limscoder","download_url":"https://codeload.github.com/limscoder/grpc-athrottle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241430297,"owners_count":19961633,"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-11-13T04:44:22.976Z","updated_at":"2026-04-19T15:32:17.573Z","avatar_url":"https://github.com/limscoder.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grpc-athrottle\n\nAdaptive throttling for golang gRPC clients\n\ngRPC interceptor that throttles outgoing connections based on trailing accept rate as described in [Google SRE Book](https://landing.google.com/sre/book/chapters/handling-overload.html).\n\n## usage\n\n```go\nimport (\n  throttle \"github.com/limscoder/grpc-athrottle\"\n  \"google.golang.org/grpc\"\n)\n\nfunc connect() {\n  opts := throttle.ThrottleOptions{\n    // sliding window for the past n minutes, used to calculate throttle ratio\n    WindowDuration:  3 * time.Minute,\n    // number of requests that must be present within WindowDuration before throttling\n    MinRequestCount: 25,\n    // ratio of requests/successes that must be met before throttling begins\n    // refered to as \"K\" in the Google SRE book\n    MaxRatio:        2.,\n    // callback function for counter events,\n    // useful for logging throttle events and/or metrics\n    Callback:        func(CounterEvent) {},\n  }\n\n  conn, err := grpc.Dial(address, grpc.WithInsecure(), grpc.WithUnaryInterceptor(\n    throttle.NewClientUnaryInterceptor(\u0026opts)))\n}\n```\n\nexample usage with event logger: https://github.com/limscoder/kubetastic/blob/master/cmd/randoui/main.go\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimscoder%2Fgrpc-athrottle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimscoder%2Fgrpc-athrottle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimscoder%2Fgrpc-athrottle/lists"}