{"id":19167170,"url":"https://github.com/dyweb/cloudab","last_synced_at":"2025-05-07T13:40:47.496Z","repository":{"id":46738585,"uuid":"337021705","full_name":"dyweb/cloudab","owner":"dyweb","description":"Cloud-Native Feature Management \u0026 A/B Testing Platform (WIP) 云原生的 A/B 测试平台","archived":false,"fork":false,"pushed_at":"2021-09-28T02:58:06.000Z","size":58,"stargazers_count":36,"open_issues_count":2,"forks_count":9,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-19T22:35:11.552Z","etag":null,"topics":["ab-testing","ab-tests","canary-test","cloud-native","feature-management"],"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/dyweb.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":"2021-02-08T09:24:56.000Z","updated_at":"2024-12-27T08:23:02.000Z","dependencies_parsed_at":"2022-07-26T05:32:29.639Z","dependency_job_id":null,"html_url":"https://github.com/dyweb/cloudab","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/dyweb%2Fcloudab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyweb%2Fcloudab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyweb%2Fcloudab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyweb%2Fcloudab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dyweb","download_url":"https://codeload.github.com/dyweb/cloudab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252888863,"owners_count":21820080,"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":["ab-testing","ab-tests","canary-test","cloud-native","feature-management"],"created_at":"2024-11-09T09:36:10.954Z","updated_at":"2025-05-07T13:40:47.471Z","avatar_url":"https://github.com/dyweb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project cloudab\n\n云原生的 A/B 测试系统\n\n## 介绍\n\nA/B 测试起源于农业工程。人们将土地划分为不同的地块，通过种植不同的农作物来确定在这些土地上更适合种植何种作物。随后 A/B 测试被广泛地应用于医学、工业等不同领域。随着谷歌论文 [Overlapping Experiment Infrastructure: More, Better, Faster Experimentation](https://storage.googleapis.com/pub-tools-public-publication-data/pdf/36500.pdf) 的发表，将 A/B 测试引入了互联网领域。\n\nA/B实验通过在线上流量中取出一部分，完全随机地分给不同的策略，再结合一定的统计方法，得到对于两种策略相对效果的准确估计。这一估计的结果可以一定程度上反映出不同的策略的优劣好坏。\n\n随着泛互联网行业竞争的加剧，过去产品经理决策驱动的策略不再能够在充分竞争的市场中取得优势。通过 A/B 测试，不同的经营策略，不同的推荐算法之间的优劣都可以通过精确估计的方式予以量化。数据比产品经理主观的意愿更具有说服力。通过数据驱动的方式，能够以更加科学的方式进行决策。\n\n## 编译\n\n```bash\nmake\n```\n\n## 运行\n\n### 本地运行\n\n```bash\n$ mongod \u0026\n$ ./bin/cloudab --logger-debug\n```\n\n### Docker 运行（TODO）\n\n## 测试\n\n可以通过导入 Postman collection 文件或者使用 cURL 进行测试。\n\n### Postman\n\n可以导入 [cloudab.postman_collection.json](docs/dev/cloudab.postman_collection.json) 进行测试。\n\n### cURL\n\n创建一个新的实验：\n\n```bash\ncurl --location --request POST 'http://localhost:9999/apis/v1/experiments' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"name\": \"test\",\n    \"versions\": [\n        {\n            \"name\": \"version-1\",\n            \"traffic\": 100,\n            \"features\": [\n                {\n                    \"name\": \"feature-1\",\n                    \"value\": \"value-1\"\n                }\n            ]\n        }\n    ]\n}'\n```\n\n返回如下：\n\n```JSON\n{\n    \"id\": \"602ca4df9f4e8f5088966f6c\",\n    \"name\": \"test\",\n    \"versions\": [\n        {\n            \"id\": \"602ca4df9f4e8f5088966f6b\",\n            \"name\": \"version-1\",\n            \"traffic\": 100,\n            \"features\": [\n                {\n                    \"name\": \"feature-1\",\n                    \"value\": \"value-1\"\n                }\n            ]\n        }\n    ]\n}\n```\n\n进行分流（将 experimentID 替换成创建实验返回结构体的 id，上述例子中是 `602ca4df9f4e8f5088966f6c`，userID 可取任意值）：\n\n```bash\ncurl --location --request GET 'http://localhost:9999/apis/v1/experiments/{experimentID}/abconfig?userID={userID}'\n```\n\n返回如下：\n\n```json\n{\n    \"features\": [\n        {\n            \"name\": \"feature-1\",\n            \"value\": \"value-1\"\n        }\n    ],\n    \"experiment_name\": \"test\",\n    \"experiment_id\": \"602ca4df9f4e8f5088966f6c\",\n    \"versions\": [\n        \"602ca4df9f4e8f5088966f6b\"\n    ]\n}\n```\n\n上报指标 （TODO）\n\n## SDK（TODO）\n\n## License\n\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyweb%2Fcloudab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdyweb%2Fcloudab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyweb%2Fcloudab/lists"}