QA/Telemetry/Developing a Telemetry Experiment: Difference between revisions

From MozillaWiki
< QA‎ | Telemetry
Jump to navigation Jump to search
(more info)
(more build info)
Line 32: Line 32:
* you can change ../build to any folder where you want to output it, '''but note:''': this folder will be erased by the build.py script
* you can change ../build to any folder where you want to output it, '''but note:''': this folder will be erased by the build.py script
* the last argument should be a string with the base URL of the server that you're going to set up  (it's used to fill some data in the generated .json file).  If you plan to publish the test server in a different path (e.g., people.mozilla.org), you will need to change it
* the last argument should be a string with the base URL of the server that you're going to set up  (it's used to fill some data in the generated .json file).  If you plan to publish the test server in a different path (e.g., people.mozilla.org), you will need to change it
* If you get an error while building it, you have something to fix in your code.
* Now you need to run a http server rooted at that folder. You can do that easily with python with:
* Now you need to run a http server rooted at that folder. You can do that easily with python with:
** <code>cd ../build</code>
** <code>cd ../build</code>
** <code>python -m SimpleHTTPServer 8080</code>
** <code>python -m SimpleHTTPServer 8080</code>
* Now it's a good opportunity to check if everything worked. Visit http://localhost:8080 if your normal web browser to see if a page shows up and it has the correct information, similar to [http://telemetry-experiment.cdn.mozilla.net/ the production page].
* Verify that the information about your experiment is correct

Revision as of 22:27, 25 February 2016

Telemetry Experiments

Getting started

  • clone the repo http://hg.mozilla.org/webtools/telemetry-experiment-server/
  • create a new folder under experiments/ for your new experiment
    • it is highly recommended that you use `hg cp` from an existing folder (this makes review easier as it's able to track the changes made to the boilerplate files)
    • e.g.
      • cd experiments; hg cp e10s-beta45-withoutaddons my-new-experiment
    • use a descriptive folder name to highlight the feature, channel and version
  • the main experiment code lives in code/bootstrap.js

Manifest file

  • the file under experiments/your-experiment/manifest.json contains the configuration details for your experiment
  • the "sample" value, for example, tells the percentage of users (matching the other criteria) that will receive your experiment

install.rdf file

  • the file under experiments/your-experiment/code/install.rdf file contains details about the experiment add-on. The <type> value for all experiments should be 128. Note that an add-on with type=128 does not work by drag'n'dropping it to Firefox like a regular add-on (it needs to be loaded by the experiment system)

Building the experiment

  • To build the experiment, you just need to create an .xpi file with your bootstrap.js and install.rdf files. Put this xpi in the root of your experiment folder (i.e., experiments/your-experiment/)
  • If you grab one example Makefile from the tree, you just need to use `make experiment` and the xpi will be created for you
    • note that the xpi is created under a build/ folder. You need to move it the proper location (the root of your experiment)

Building the server

  • To test, you need to build the telemetry server (which is a simple static folder). To build it, you do in the root of the repo:
  • you can change ../build to any folder where you want to output it, but note:: this folder will be erased by the build.py script
  • the last argument should be a string with the base URL of the server that you're going to set up (it's used to fill some data in the generated .json file). If you plan to publish the test server in a different path (e.g., people.mozilla.org), you will need to change it
  • If you get an error while building it, you have something to fix in your code.
  • Now you need to run a http server rooted at that folder. You can do that easily with python with:
    • cd ../build
    • python -m SimpleHTTPServer 8080
  • Now it's a good opportunity to check if everything worked. Visit http://localhost:8080 if your normal web browser to see if a page shows up and it has the correct information, similar to the production page.
  • Verify that the information about your experiment is correct