{"id":28158450,"url":"https://github.com/indeedeng/proctor-demo","last_synced_at":"2025-05-15T09:20:00.676Z","repository":{"id":10850146,"uuid":"13132065","full_name":"indeedeng/proctor-demo","owner":"indeedeng","description":"Reference implementation that demonstrates core Proctor functionality","archived":false,"fork":false,"pushed_at":"2023-06-14T22:33:40.000Z","size":306,"stargazers_count":33,"open_issues_count":2,"forks_count":23,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-07T23:40:07.621Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indeedeng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-09-26T19:24:58.000Z","updated_at":"2023-11-12T14:13:41.000Z","dependencies_parsed_at":"2023-10-21T11:54:48.372Z","dependency_job_id":null,"html_url":"https://github.com/indeedeng/proctor-demo","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/indeedeng%2Fproctor-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indeedeng%2Fproctor-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indeedeng%2Fproctor-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indeedeng%2Fproctor-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indeedeng","download_url":"https://codeload.github.com/indeedeng/proctor-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310504,"owners_count":22049471,"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":[],"created_at":"2025-05-15T09:19:35.563Z","updated_at":"2025-05-15T09:20:00.664Z","avatar_url":"https://github.com/indeedeng.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Proctor Demo and Reference Implementation\n\n![Lifecycle](https://img.shields.io/osslifecycle/indeedeng/utilproctor-demo.svg)\n\nThis project is a reference implementation and demonstration of [Proctor](https://github.com/indeedeng/proctor), a Java-based A/B testing framework by [Indeed](http://engineering.indeed.com). It is a simple Spring MVC webapp that uses Proctor to determine what background color to set for a web application.\n\nFor more information, see the [Proctor documentation](http://indeedeng.github.io/proctor). The [Quick Start](http://indeedeng.github.io/proctor/docs/quick-start/) document is a good guide to understanding the code in this reference implementation.\n\n## Demo Online\n\nThe demo is (usually) running at [proctordemo.site](https://proctordemo.site). It loads its [test definitions](http://indeedeng.github.io/proctor/docs/terminology/#toc_4) from JSON files that can be at any URL. The examples below are self-hosted within the demo app itself. A URL parameter allows you to change the definition file.\n\n### Things to Try\n\n1. Testing two colors at 25% and 25%: [link](https://proctordemo.site/?defn=%2Fdefn%2Fexample.json).  Click \"Show Details\" and \"Reset\" to change your user ID and (possibly) be put in a different test bucket.\n\n1. Testing the same two colors at 50% and 50%: [link](https://proctordemo.site/?defn=%2Fdefn%2Fexample2.json)\n\n1. Going to 100% for one color: [link](https://proctordemo.site/?defn=%2Fdefn%2Fexample3.json)\n\n1. Using `prforceGroups` to see a different test group, regardless of allocations: [link](https://proctordemo.site/?prforceGroups=bgcolortst3)\n\n1. Reset to discard the forced group in the previous step: [link](https://proctordemo.site/reset)\n\n1. Basing color on Android vs. iOS user agent instead of random allocation: [link](https://proctordemo.site/?defn=%2Fdefn%2Fdemo.json). If you're not on Android or iOS you won't see a background color.\n\n#### Web-Based Remote Service API\n\nAn additional endpoint `/rpc` is provided in this implementation as an example of how you might implement group selection as a remote service. To use this endpoint, you must provide as least the `uid` (user ID) and `agent` (user agent) query parameters. It does not use any cookies or HTTP headers directly. It supports these parameters:\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003eParameter\u003c/td\u003e\n\u003ctd\u003eDescription\u003c/td\u003e\n\u003ctd\u003eRequired?\u003c/td\u003e\n\u003ctd\u003eExample\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003euid\u003c/td\u003e\n\u003ctd\u003eUser ID for USER-based tests (can be any string)\u003c/td\u003e\n\u003ctd\u003eYes\u003c/td\u003e\n\u003ctd\u003e8ac65ba448be45afb86706e8cab979cf\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eagent\u003c/td\u003e\n\u003ctd\u003eUser Agent (equivalent to User-Agent HTTP header)\u003c/td\u003e\n\u003ctd\u003eYes (may be blank)\u003c/td\u003e\n\u003ctd\u003eMozilla/5.0\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003edefn\u003c/td\u003e\n\u003ctd\u003eDefinition URL\u003c/td\u003e\n\u003ctd\u003eNo (uses default if not provided)\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://raw.githubusercontent.com/indeedeng/proctor-demo/master/src/main/webapp/defn/example.json\"\u003e/defn/example.json\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## Building and Running Demo Locally\n\n1. `mvn clean package \u0026\u0026 java -jar target/dependency/webapp-runner.jar target/*.war`\n\n1. Go to [http://localhost:8080/](http://localhost:8080/)\n\nTo run on a different port locally, use the `--port` option for webapp-runner. For example, to run on port 9999:\n```\njava -jar target/dependency/webapp-runner.jar --port 9999 target/*.war\n```\n\n## The Source\n\n### [ProctorGroups.json](https://github.com/indeedeng/proctor-demo/blob/master/src/main/proctor/com/indeed/demo/ProctorGroups.json)\nThe JSON specification that is enumerates the test and its buckets. This is used to generate convenience classes at compile time and to load the test matrix at runtime.\n\n### [DefinitionManager.java](https://github.com/indeedeng/proctor-demo/blob/master/src/main/java/com/indeed/demo/proctor/DefinitionManager.java)\nHelper component that manages loading and caching the test matrix from a definition file at a remote URL.\n\n### [DemoController.java](https://github.com/indeedeng/proctor-demo/blob/master/src/main/java/com/indeed/demo/proctor/DemoController.java)\nSpring controller that handles assigning a UUID cookie to identify the user and calling into proctor to get the groups for the current user. Also provides `/rpc` service endpoint support.\n\n### [demo.jsp](https://github.com/indeedeng/proctor-demo/blob/master/src/main/webapp/WEB-INF/jsp/demo.jsp)\nJava Servlet Page view for the demo controller; renders the test behavior and some controls to interact with the demo.\n\n### [UserAgent.java](https://github.com/indeedeng/proctor-demo/blob/master/src/main/java/com/indeed/web/useragents/UserAgent.java)\nA helper class based partially on bitwalker's UserAgentUtils that can be a useful context parameter for proctor.\n\n# Code of Conduct\nThis project is governed by the [Contributor Covenant v 1.4.1](CODE_OF_CONDUCT.md)\n\n# License\n\n[Apache License Version 2.0](https://github.com/indeedeng/proctor-demo/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findeedeng%2Fproctor-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findeedeng%2Fproctor-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findeedeng%2Fproctor-demo/lists"}