{"id":37041768,"url":"https://github.com/rmandvikar/feature-toggle","last_synced_at":"2026-01-14T04:56:05.113Z","repository":{"id":69948826,"uuid":"363522782","full_name":"rmandvikar/feature-toggle","owner":"rmandvikar","description":"Few dials for feature toggle.","archived":false,"fork":false,"pushed_at":"2025-07-26T22:34:33.000Z","size":82,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2025-07-27T02:16:11.667Z","etag":null,"topics":["dial","feature-toggle"],"latest_commit_sha":null,"homepage":"","language":"C#","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/rmandvikar.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}},"created_at":"2021-05-01T22:52:38.000Z","updated_at":"2025-07-26T22:27:39.000Z","dependencies_parsed_at":"2024-01-15T09:37:02.754Z","dependency_job_id":"d3d75267-768f-4be6-a16b-3f2d076e80b0","html_url":"https://github.com/rmandvikar/feature-toggle","commit_stats":null,"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/rmandvikar/feature-toggle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmandvikar%2Ffeature-toggle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmandvikar%2Ffeature-toggle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmandvikar%2Ffeature-toggle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmandvikar%2Ffeature-toggle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmandvikar","download_url":"https://codeload.github.com/rmandvikar/feature-toggle/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmandvikar%2Ffeature-toggle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28409922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["dial","feature-toggle"],"created_at":"2026-01-14T04:56:04.670Z","updated_at":"2026-01-14T04:56:05.105Z","avatar_url":"https://github.com/rmandvikar.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Feature Toggle\n\nFew dials for feature toggle.\n\n[![NuGet version (rm.FeatureToggle)](https://img.shields.io/nuget/v/rm.FeatureToggle.svg?style=flat-square)](https://www.nuget.org/packages/rm.FeatureToggle/)\n\n#### PercentageDial\n\n`ToDial(percentage)` returns `true` with a `percentage` probability. It has a dependency on `Random` which needs to be thread-safe. See thread-safe `Random` implementations [here](https://github.com/rmandvikar/random2) ([nuget](https://www.nuget.org/packages/rm.Random2)). `percentage` range is `[0.01-100.00]` (2 decimal places precision).\n\n#### CountDial\n\n`ToDial(count)` returns `true` for first `count` calls, and `false` after. It's useful to sample few calls before dialing with a percentage. It maintains an internal counter with a lock. Dialing `count` to `0` does not incur the lock perf hit.\n\n#### CountThenPercentageDial\n\n`ToDial(count, percentage)` returns `true` for first `count` calls, and then with a `percentage` probability. It uses `CountDial` and `PercentageDial` underneath the hood, and provides flexibility to sample few calls first and then dial with a percentage. Due to the lock perf hit (except when `count` is `0`), it's better to eventually change to `PercentageDial`.\n\n#### IdDial\n\n`ToDial(id, percentage)` returns `true` if the calculated value of a string `id` (`[0.01-100.00]` and deterministic) is less than or equal to `percentage`. This dial makes the dialing a function of something (`id`) versus randomness. It's deterministic so `IsDial(id, percentage)` will keep returning `true` as long as the `percentage` is same or increasing. It will behave uniformly if the `id` values have high cardinality, and with no traffic clustering.\n\n#### DateRangeDial\n\n`ToDial(startDate, endDate)` returns `true` if the current date value is within the date range. If `startDate` \u003e `endDate`, `false` is returned instead of throwing for convenience.\n\n#### Probability\n\n`IsTrue(percentage)` returns `true` with a `percentage` probability. It acts as a helper method, and is used internally by `PercentageDial`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmandvikar%2Ffeature-toggle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmandvikar%2Ffeature-toggle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmandvikar%2Ffeature-toggle/lists"}