{"id":17874792,"url":"https://github.com/dastergon/py-deterministic-subsetting","last_synced_at":"2025-03-21T23:31:32.067Z","repository":{"id":48341507,"uuid":"135341784","full_name":"dastergon/py-deterministic-subsetting","owner":"dastergon","description":"Deterministic Subsetting as defined in the SRE book","archived":false,"fork":false,"pushed_at":"2021-12-01T15:55:47.000Z","size":2,"stargazers_count":4,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T05:51:19.473Z","etag":null,"topics":["load-balancer","loadbalancing","python","site-reliability-engineering","srebook"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dastergon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-29T19:11:38.000Z","updated_at":"2021-12-01T15:55:49.000Z","dependencies_parsed_at":"2022-08-26T02:42:09.213Z","dependency_job_id":null,"html_url":"https://github.com/dastergon/py-deterministic-subsetting","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/dastergon%2Fpy-deterministic-subsetting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastergon%2Fpy-deterministic-subsetting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastergon%2Fpy-deterministic-subsetting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastergon%2Fpy-deterministic-subsetting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dastergon","download_url":"https://codeload.github.com/dastergon/py-deterministic-subsetting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244885018,"owners_count":20526282,"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":["load-balancer","loadbalancing","python","site-reliability-engineering","srebook"],"created_at":"2024-10-28T11:11:27.589Z","updated_at":"2025-03-21T23:31:31.797Z","avatar_url":"https://github.com/dastergon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Subset Selection Algorithm: Deterministic Subsetting\n\nSource: https://landing.google.com/sre/book/chapters/load-balancing-datacenter.html\n\n**Subsetting**: limiting the pool of potential backend tasks with which a client task interacts.\n\nWhat the algorithm does according to the [Site Reliability Engineering](https://landing.google.com/sre/book/chapters/load-balancing-datacenter.html) book:\n\n\"We divide client tasks into \"rounds,\" where round i consists of subset_count consecutive client tasks, starting at task subset_count × i, and subset_count is the number of subsets (i.e., the number of backend tasks divided by the desired subset size). Within each round, each backend is assigned to exactly one client (except possibly the last round, which may not contain enough clients, so some backends may not be assigned).\"\n\n\n### How to use\n```python\nfrom subset import Subset\n\ndef main():\n    backends = []\n    for i in xrange(12):\n        backends.append(i)\n\n    result = {}\n    subset_size = 3\n    for client_id in xrange(10):\n        result[client_id] = Subset(backends=backends, client_id=client_id, subset_size=subset_size)\n\n    for client_id, backend in result.iteritems():\n        print(\"{}: {}\".format(client_id, backend))\n\nif __name__ == \"__main__\":\n    main()\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdastergon%2Fpy-deterministic-subsetting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdastergon%2Fpy-deterministic-subsetting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdastergon%2Fpy-deterministic-subsetting/lists"}