1. Design 2. Launch 3. Analyze
Experimenter is a platform for managing experiments in Mozilla Firefox.
https://experimenter-app.dev.mozaws.net/
https://experimenter.stage.mozaws.net/
https://experimenter.services.mozilla.com/
An experiment is a way to measure how a change to your product affects how people use it.
An experiment has three parts:
- A new feature that can be selectively enabled
- A group of users to test the new feature
- Telemetry to measure how people interact with the new feature
- Build a new feature behind a pref flag
- Define an experiment for that feature in Experimenter
- Send it to Shield
- After Shield reviews and approves it, it is sent to Firefox
- Firefox clients check whether they should enroll in the experiment and configure themselves accordingly
- Telemetry about the experiment is collected
- Dashboards are created to visualize the telemetry
- Analyze and collect the results to understand how the new feature impacted users
- Do it again!
-
Install docker on your machine
-
Clone the repo
git clone <your fork>
-
Copy the sample env file
cp .env.sample .env
-
Set DEBUG=True for local development
vi .env
-
Create a new secret key and put it in .env
make secretkey
-
Run tests
make test
-
Run database migrations
make migrate
-
Make a local user
make createuser
-
Run a dev instance
make up
-
Navigate to it and add an SSL exception to your browser
https://localhost/
Done!
Experimenter uses docker for all development, testing, and deployment.
The following helpful commands have been provided via a Makefile:
Build the application container by executing the build script
Build the supporting services (nginx, postgresql) defined in the compose file
Start a dev server listening on port 80 using the Django runserver
Run the Django test suite with code coverage
Run flake8 against the code
Run both test and lint
Apply all django migrations
Create an admin user in the local dev instance
Start an ipython shell inside the container (this lets you import and test code, interact with the db, etc)
Start a bash shell inside the container (this lets you interact with the containerized filesystem)
Create dummy SSL certs to use the dev server over a locally secure connection. This helps test client behaviour with a secure connection. This task is run automatically when needed.
Stop and delete all docker containers.
WARNING: this will remove your database and all data. Use this to reset your dev environment.
List all of the started experiments.
project__slug - Return only the experiments for a given project, an invalid slug will raise 404 status - Return only the experiments with the given status, options are:
- 'Draft'
- 'Review'
- 'Ship'
- 'Accepted'
- 'Live'
- 'Complete'
- 'Rejected'
Example: GET /api/v1/experiments/?project__slug=project-slug&status=Pending
[
{
"accept_url":"https://localhost/api/v1/experiments/self-enabling-needs-based-hardware/accept",
"client_matching":"Locales: en-US, en-CA, en-GB\nGeos: US, CA, GB\nSome \"additional\" filtering",
"control":{
"description":"Eos sunt adipisci beatae. Aut sunt totam maiores reprehenderit sed vero. Nam fugit sequi repellendus cumque. Fugit maxime suscipit eius quas iure exercitationem voluptatibus.",
"name":"Seamless 5thgeneration task-force",
"ratio":7,
"slug":"seamless-5thgeneration-task-force",
"value":"\"synergized-client-driven-artificial-intelligence\""
},
"end_date":1505767052000.0,
"experiment_slug":"pref-flip-re-contextualized-systemic-synergy-self-enabling-needs-based-hardware",
"experiment_url":"https://localhost/experiments/experiment/144/change/",
"firefox_channel":"Release",
"firefox_version":"57.0",
"name":"Self-enabling needs-based hardware",
"objectives":"Illo maiores libero ratione. Dolorum nostrum molestiae blanditiis cumque. Libero saepe ipsum accusantium maxime.",
"population_percent":"60.0000",
"pref_branch":"default",
"pref_key":"browser.phased.hybrid.implementation.enabled",
"pref_type":"string",
"project_name":"Re-contextualized systemic synergy",
"project_slug":"re-contextualized-systemic-synergy",
"reject_url":"https://localhost/api/v1/experiments/self-enabling-needs-based-hardware/reject",
"slug":"self-enabling-needs-based-hardware",
"start_date":1505767052000.0,
"variant":{
"description":"Modi perferendis repudiandae ducimus dolorem eum rem. Esse porro iure consectetur facere. Quidem nam enim dolore eius ab facilis.",
"name":"Business-focused upward-trending Graphic Interface",
"ratio":2,
"slug":"business-focused-upward-trending-graphic-interface",
"value":"\"synchronized-upward-trending-knowledgebase\""
}
},
]
Return a serialization of the requested experiment.
Example: GET /api/v1/experiments/self-enabled-needs-based-hardware/
{
"accept_url":"https://localhost/api/v1/experiments/self-enabling-needs-based-hardware/accept",
"client_matching":"Locales: en-US, en-CA, en-GB\nGeos: US, CA, GB\nSome \"additional\" filtering",
"control":{
"description":"Eos sunt adipisci beatae. Aut sunt totam maiores reprehenderit sed vero. Nam fugit sequi repellendus cumque. Fugit maxime suscipit eius quas iure exercitationem voluptatibus.",
"name":"Seamless 5thgeneration task-force",
"ratio":7,
"slug":"seamless-5thgeneration-task-force",
"value":"\"synergized-client-driven-artificial-intelligence\""
},
"end_date":1505767052000.0,
"experiment_slug":"pref-flip-re-contextualized-systemic-synergy-self-enabling-needs-based-hardware",
"experiment_url":"https://localhost/experiments/experiment/144/change/",
"firefox_channel":"Release",
"firefox_version":"57.0",
"name":"Self-enabling needs-based hardware",
"objectives":"Illo maiores libero ratione. Dolorum nostrum molestiae blanditiis cumque. Libero saepe ipsum accusantium maxime.",
"population_percent":"60.0000",
"pref_branch":"default",
"pref_key":"browser.phased.hybrid.implementation.enabled",
"pref_type":"string",
"project_name":"Re-contextualized systemic synergy",
"project_slug":"re-contextualized-systemic-synergy",
"reject_url":"https://localhost/api/v1/experiments/self-enabling-needs-based-hardware/reject",
"slug":"self-enabling-needs-based-hardware",
"start_date":1505767052000.0,
"variant":{
"description":"Modi perferendis repudiandae ducimus dolorem eum rem. Esse porro iure consectetur facere. Quidem nam enim dolore eius ab facilis.",
"name":"Business-focused upward-trending Graphic Interface",
"ratio":2,
"slug":"business-focused-upward-trending-graphic-interface",
"value":"\"synchronized-upward-trending-knowledgebase\""
}
}
Body: None
Set the status of a Pending experiment to Accepted.
Example: PATCH /api/v1/experiments/my-first-experiment/accept
content-type: application/json
Body: {message: "This experiment was rejected for reasons."}
Set the status of a Pending experiment to Rejected.
Example: PATCH /api/v1/experiments/my-first-experiment/accept
- Fork the repo!
- File a new issue describing the change you want to make: Change the things #123
- Create your feature branch with the issue number:
git checkout -b 123
- Commit your changes:
git commit -am 'Changed the things fixes #123'
- Push to the branch:
git push origin 123
- Submit a pull request :D
Experimenter uses the Mozilla Public License