Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report A4A experiment to CSI. #8958

Merged
merged 2 commits into from Apr 26, 2017
Merged

Conversation

lannka
Copy link
Contributor

@lannka lannka commented Apr 26, 2017

  • refactored experiments.js a bit to expose addEnabledExperiment method
  • report A4A experiment branches to CSI using addEnabledExperiment method
  • removed unused legacy-cdn-domain experiment

@lannka lannka requested review from erwinmombay and tdrl April 26, 2017 04:20
this.ampexp_ = '';

// Add RTV version as experiment ID, so we can slice the data by version.
this.addEnabledExperiment(getMode(this.win).rtvVersion);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, if I'm reading the code right, the ampexp_ field (and, therefore, your ampexp CSI message) will look something like this:

'canary,experiment_foo,0012355768,experiment_bar'

where '0012355768' is the AMP runtime version, right? My question is how you will recognize the runtime version field during analysis, later? As long as it's the only numeric field, you can find it with a regex or something. But I'm concerned that somebody may insert another numeric experiment name, which would make it hard to separate out the version string. Would it be reasonable to add a prefix or something to make it more identifiable? rtv_0012355768 or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good suggestion. i can do it in a separate PR since this is already in prod, and it will change prod behavior.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

perf.flush();
expect(viewerSendMessageStub).to.be.calledWith('sendCsi', {
ampexp: getMode(win).rtvVersion,
ampexp: getMode(win).rtvVersion + ',experiment-a,experiment-b',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends on the order in which Object.keys() returns the keys, I think. Is that guaranteed in JavaScript? In most languages it's not for a Map.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I improved the asserts. PTAL

@lannka lannka merged commit 8206e30 into ampproject:master Apr 26, 2017
@lannka lannka deleted the report-a4a-experiment branch April 26, 2017 19:37
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
* Report A4A experiment to CSI.

* Address comments, improve test asserts.
KenneyE pushed a commit to spotxchange/amphtml that referenced this pull request May 3, 2017
* Report A4A experiment to CSI.

* Address comments, improve test asserts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants