{"id":28724150,"url":"https://github.com/processone/oneup","last_synced_at":"2026-06-19T23:31:14.271Z","repository":{"id":136895103,"uuid":"243478543","full_name":"processone/oneup","owner":"processone","description":"NIF powered global counters for erlang","archived":false,"fork":false,"pushed_at":"2020-02-27T09:30:05.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-03-14T11:27:03.658Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/processone.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":"2020-02-27T09:18:23.000Z","updated_at":"2020-02-27T09:33:35.000Z","dependencies_parsed_at":"2023-04-14T01:30:45.163Z","dependency_job_id":null,"html_url":"https://github.com/processone/oneup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/processone/oneup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Foneup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Foneup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Foneup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Foneup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/processone","download_url":"https://codeload.github.com/processone/oneup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Foneup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34552295,"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-19T02:00:06.005Z","response_time":61,"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":[],"created_at":"2025-06-15T10:09:19.960Z","updated_at":"2026-06-19T23:31:14.265Z","avatar_url":"https://github.com/processone.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oneup\n\nNIF powered, lock-free global counters for erlang using the c++11 atomic package.\n\nOneup is an alternative to `ets:update_counter` with improved throughput for multiple writers without the lock contention that can happen with ets.\n\n### Status\n\noneup is not currently used in production and is subject to API changes. \n\n### Usage\n\nCreate a new counter. This returns a reference that is required for further oneup operations. There is no public registry of oneup counters. Oneup counters are garbage collected like any other erlang primitive e.g. binary or tuple.\n\n```erlang\nC = oneup:new_counter().\n```\n\nIncrement or set the counter. Any number of processes can safely increment or set a counter. A 64 bit signed long is used to hold the value, not an erlang auto number. The maximum value is (2^63-1) or less depending on architecture.\n\n```erlang\nok = oneup:inc(C). %% value of C becomes 1\nok = oneup:inc2(C, 10).  %% value of C becomes 11\n11 = oneup:set(C, 200). %% set to 200 and return previous value\n```\n\nSet min or max. \n\n```\n300 = oneup:set_max(C, 300). %% set to max of current and new value and return max\n300 = oneup:set_max(C, 100).\n100 = oneup:set_min(C, 100). %% set to min of current and new value and return min\n100 = oneup:set_min(C, 300).\n```\n\nRetrieve the result. Any number of processes can safely read a counter.\n\n```erlang\n200 = oneup:get(C).\n```\n\n### Performance\n\nThe benchnmark suite can be run by executing the following from the oneup directory:\n\n    make perfs\n\nThis runs a benchmarks of oneup and `ets:update_counter` tests. Testing has shown that oneup can achieve upto 100 times the throughput of ets when multiple processes write to a single key.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprocessone%2Foneup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprocessone%2Foneup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprocessone%2Foneup/lists"}