Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
Increase localFetch experiment population to 20% fixes #2144
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredlockhart committed Feb 14, 2017
1 parent cdacb67 commit 31261e2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addon/Feeds/MetadataFeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = class MetadataFeed extends Feed {
this.linksToFetch.clear();

// if we are in the experiment, make a network request through PageScraper
if (simplePrefs.prefs["experiments.locallyFetchMetadata"]) {
if (simplePrefs.prefs["experiments.locallyFetchMetadata20"]) {
return this.options.fetchNewMetadataLocally(links, "METADATA_FEED_REQUEST").then(() => (am.actions.Response("METADATA_FEED_UPDATED")));
}
return this.options.fetchNewMetadata(links, "METADATA_FEED_REQUEST").then(() => (am.actions.Response("METADATA_FEED_UPDATED")));
Expand Down
4 changes: 2 additions & 2 deletions content-test/addon/Feeds/MetadataFeed.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ describe("MetadataFeed", () => {
assert.calledOnce(instance.options.fetchNewMetadata)))
);
it("should run sites through fetchNewMetadataLocally if experiment pref is on", () => {
simplePrefs.prefs["experiments.locallyFetchMetadata"] = true;
simplePrefs.prefs["experiments.locallyFetchMetadata20"] = true;
return instance.getData().then(() => {
assert.notCalled(instance.options.fetchNewMetadata);
assert.calledOnce(instance.options.fetchNewMetadataLocally);
simplePrefs.prefs["experiments.locallyFetchMetadata"] = false;
simplePrefs.prefs["experiments.locallyFetchMetadata20"] = false;
});
});
it("should resolve with an action, but no data", () => (
Expand Down
17 changes: 16 additions & 1 deletion experiments.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
},
"locallyFetchMetadata": {
"name": "Fetch Page Content Locally",
"active": true,
"active": false,
"description": "Make a network request for content of a URL",
"control": {
"value": false,
Expand Down Expand Up @@ -133,5 +133,20 @@
"threshold": 0.2,
"description": "Show screenshots"
}
},
"locallyFetchMetadata20": {
"name": "Fetch Page Content Locally",
"active": true,
"description": "Make a network request for content of a URL",
"control": {
"value": false,
"description": "Use remote service for metadata"
},
"variant": {
"id": "exp-010-locally-fetch-metadata",
"value": true,
"threshold": 0.2,
"description": "Fetch page content locally"
}
}
}

0 comments on commit 31261e2

Please sign in to comment.