{"id":19708248,"url":"https://github.com/zzzming/erl-rate-limiter","last_synced_at":"2026-06-13T17:02:02.933Z","repository":{"id":157650528,"uuid":"121455907","full_name":"zzzming/erl-rate-limiter","owner":"zzzming","description":"Counts and limits rate in Erlang","archived":false,"fork":false,"pushed_at":"2019-06-19T21:26:26.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T18:23:33.880Z","etag":null,"topics":["erlang","rate-limit"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","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/zzzming.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":"2018-02-14T01:03:40.000Z","updated_at":"2020-05-01T18:13:25.000Z","dependencies_parsed_at":"2024-06-20T04:48:59.639Z","dependency_job_id":null,"html_url":"https://github.com/zzzming/erl-rate-limiter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zzzming/erl-rate-limiter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzming%2Ferl-rate-limiter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzming%2Ferl-rate-limiter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzming%2Ferl-rate-limiter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzming%2Ferl-rate-limiter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zzzming","download_url":"https://codeload.github.com/zzzming/erl-rate-limiter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzming%2Ferl-rate-limiter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34292326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["erlang","rate-limit"],"created_at":"2024-11-11T21:42:50.496Z","updated_at":"2026-06-13T17:02:02.898Z","avatar_url":"https://github.com/zzzming.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"rate\n=====\n\nrate is an application to count the rates and provide rate limit count.\n\nUse\n---\n To start the rate app.\n```\n   1\u003e ok = application:start(rate_app).\n   ok\n```\n\n To count the rate of 1. An automatic timer clears rate counts every second for the second bin.\n```\n   2\u003e rate:add(1).\n   {ok,1}\n```\n\n To count the rate of 100 and check the current counts for the second bin.\n```\n   3\u003e {ok, 100} = rate:add(100).\n   {ok,100}\n```\n\n Print the rate counters for the latest second bin, latest minute, 5 and 15 minutes bin, and the peak count per second.\n```\n   4\u003e rate:print().\n   #rates{second = 0,minute = 101,last5min = 101,last15min = 101,peak = 100}ok\n```\n\n Check the rate limit with an incremental count.\n```\n   5\u003e {error, -1} = rate:remain(101, 100). % rate limit over 1\n   {error,-1}\n   6\u003e {ok, 399} = rate:remain(1, 400).  % still 399 counts left for the current second\n   {ok,399}\n```\n\nBuild\n-----\nCommands to compile, static analysis, and unit testing.\n```\n    $ rebar3 compile\n    $ rebar3 dialyzer\n    $ rebar3 eunit\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzzming%2Ferl-rate-limiter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzzzming%2Ferl-rate-limiter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzzming%2Ferl-rate-limiter/lists"}