{"id":22911934,"url":"https://github.com/itsubaki/subset","last_synced_at":"2026-03-09T19:03:04.436Z","repository":{"id":90237478,"uuid":"110794762","full_name":"itsubaki/subset","owner":"itsubaki","description":"Load balancing algorithm written in Go","archived":false,"fork":false,"pushed_at":"2023-01-16T10:58:34.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T20:39:12.901Z","etag":null,"topics":["google","loadbalancing","sre"],"latest_commit_sha":null,"homepage":"","language":"Go","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/itsubaki.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-15T06:45:48.000Z","updated_at":"2023-09-22T10:55:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b5b457a-6e3c-4840-9750-02189007cc4d","html_url":"https://github.com/itsubaki/subset","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/itsubaki%2Fsubset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsubaki%2Fsubset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsubaki%2Fsubset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsubaki%2Fsubset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsubaki","download_url":"https://codeload.github.com/itsubaki/subset/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253174370,"owners_count":21865852,"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":["google","loadbalancing","sre"],"created_at":"2024-12-14T04:19:17.708Z","updated_at":"2026-03-09T19:03:04.424Z","avatar_url":"https://github.com/itsubaki.png","language":"Go","readme":"# subset\n\n - Fisher–Yates shuffle\n - \"A Subset Selection Algorithm: Deterministic Subsetting\" in [Site Reliability Engineering](https://landing.google.com/sre/book.html)\n\n## Example\n\n```go\nfunc testdatagen(size int) []int {\n\tids := make([]int, size)\n\tfor i := range size {\n\t\tids[i] = i\n\t}\n\n\treturn ids\n}\n\nfunc Example() {\n\tbackendSize := 100\n\tbackendIDs := testdatagen(backendSize)\n\n\tsubsetSize := 10\n\ts := subset.New(backendIDs, subsetSize)\n\n\tclientSize := 10\n\tclientIDs := testdatagen(clientSize)\n\tfor _, clientID := range clientIDs {\n\t\tselected := s.Select(clientID)\n\t\tfmt.Printf(\"ClientID: %v -\u003e BackendIDs: %2v\\n\", clientID, selected)\n\t}\n\n\t// Output:\n\t// ClientID: 0 -\u003e BackendIDs: [55 58 54 75 66 33 34 24  9 16]\n\t// ClientID: 1 -\u003e BackendIDs: [56 14 31 63 88 60 46 47 94 39]\n\t// ClientID: 2 -\u003e BackendIDs: [45  1 12 26 21 52 32  7 74 70]\n\t// ClientID: 3 -\u003e BackendIDs: [93 64 96 37 99 90 11  6 27 87]\n\t// ClientID: 4 -\u003e BackendIDs: [83 17 76  0 35 95 43 92 77 91]\n\t// ClientID: 5 -\u003e BackendIDs: [36 97 73 28 19 30 48 10 61 82]\n\t// ClientID: 6 -\u003e BackendIDs: [ 3 59 40 25 44 13 86  4 98 72]\n\t// ClientID: 7 -\u003e BackendIDs: [20 18 41  5 49 84 68 81 51 38]\n\t// ClientID: 8 -\u003e BackendIDs: [29  2 67 15 71 89 57 23 78 79]\n\t// ClientID: 9 -\u003e BackendIDs: [62 50 85 65 42  8 53 69 22 80]\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsubaki%2Fsubset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsubaki%2Fsubset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsubaki%2Fsubset/lists"}