{"id":13713731,"url":"https://github.com/alextanhongpin/go-a-b","last_synced_at":"2025-09-08T03:36:34.047Z","repository":{"id":79114891,"uuid":"106786989","full_name":"alextanhongpin/go-a-b","owner":"alextanhongpin","description":"A/B testing metrics collection with golang","archived":false,"fork":false,"pushed_at":"2017-10-28T04:51:55.000Z","size":47,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T16:14:50.477Z","etag":null,"topics":["bandit-algorithm","go","golang","nomad"],"latest_commit_sha":null,"homepage":null,"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/alextanhongpin.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-10-13T06:33:24.000Z","updated_at":"2022-03-21T08:44:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"d982727e-3f2c-435a-80e2-65cec63ec1f6","html_url":"https://github.com/alextanhongpin/go-a-b","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alextanhongpin/go-a-b","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fgo-a-b","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fgo-a-b/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fgo-a-b/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fgo-a-b/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alextanhongpin","download_url":"https://codeload.github.com/alextanhongpin/go-a-b/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fgo-a-b/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274129248,"owners_count":25227204,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"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":["bandit-algorithm","go","golang","nomad"],"created_at":"2024-08-02T23:01:42.976Z","updated_at":"2025-09-08T03:36:34.001Z","avatar_url":"https://github.com/alextanhongpin.png","language":"Go","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"# go-a/b\n\nA simple a/b metrics data collection and visualization with redis.\n\n## Example loading lua script from golang\n\n```golang\nfunc () {\n  //\n\tscript1 := client.ScriptLoad(`local value = cmsgpack.pack({ARGV[2], ARGV[1]})\nredis.call('zadd', KEYS[1], ARGV[1], value)\nreturn redis.status_reply('ok')`)\n\n\tif script1.Err() != nil {\n\t\tlog.Println(\"error loading script:\", script1.Err().Error())\n\t}\n\t// Else, get the sha\n\tsha := script1.Val()\n\tlog.Println(sha)\n\n\tcmd2 := client.EvalSha(sha, []string{\"test:1\"}, \"1421481600000\", \"yes\")\n}\n```\n\n\n## Bandit algorithm requirements\n\n\nAs a user, \u003cbr\u003e\nI want to create a new bandit test, \u003cbr\u003e\nIn order to test the performance of the ui.\n\n|------------------------------|\n| Feature      | Pull | Reward |\n|--------------|------|--------|\n| Red button   | 0    | 0      |\n| Green button | 0    | 0      |\n| Blue button  | 0    | 0      |\n|------------------------------|\n\nAs a user, \u003cbr\u003e\nI want to set the initial values of the bandit, \u003cbr\u003e\nIn order to have better control over the exploitation.\n\n```bash\n$ PUT /bandits/experiment-name\n\n{\n\t\"values\": [0,1,2,3]\n}\n```\n\n- upload data \n- download data\n- replay from last\n- reset from start\n- duplicate\n- getURL\n- update experiment name\n- update labels\n- set labels\n- get reward/pull ratio\n- store in memory/redis/dedicated storage?\n\n\nFrontend guide\n\n1. Call the api to select an arm\n2. The call should return the arm, the feature information and some metadata\n3. The data should be cached locally so that the user does not need to call the cached data again (persistent)\n4. If the user clicks it, then update it with the score 1\n5. Else if the user navigates out of the page without doing anything, then update it with the score 0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextanhongpin%2Fgo-a-b","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falextanhongpin%2Fgo-a-b","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextanhongpin%2Fgo-a-b/lists"}