-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat(specs): add estimate path and responses [skip-bc] #4057
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
efa672a
feat: add estimate path and responses
cdhawke 3b52e85
fix: reference
cdhawke 3ba7922
feat: add test
cdhawke 2732ff3
fix: test
cdhawke 2aa6807
fix: test
cdhawke f9c8038
chore: tests
cdhawke 2746d95
chore: adjust parameters again
cdhawke be5035f
chore: additional changes
cdhawke 30ed903
chore: change estimate
cdhawke 7f199a8
chore: rename and change spec
cdhawke e06f159
chore: rename metric to effectmetric
cdhawke ed7d93c
fix: cts enum syntax....
cdhawke 47c6aee
Merge branch 'main' into feat/abtests/estimate
millotp c75b847
fix number
millotp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
EstimateABTestResponse: | ||
type: object | ||
properties: | ||
durationDays: | ||
type: integer | ||
format: int64 | ||
description: Estimated number of days needed to reach the sample sizes required for detecting the configured effect. This value is based on historical traffic. | ||
example: 21 | ||
controlSampleSize: | ||
type: integer | ||
format: int64 | ||
description: Number of tracked searches needed to be able to detect the configured effect for the control variant. | ||
example: 23415 | ||
experimentSampleSize: | ||
type: integer | ||
format: int64 | ||
description: Number of tracked searches needed to be able to detect the configured effect for the experiment variant. | ||
example: 23415 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
post: | ||
tags: | ||
- abtest | ||
operationId: estimateABTest | ||
x-acl: | ||
- analytics | ||
summary: Estimate the sample size and duration of an A/B test | ||
description: Given the traffic percentage and the expected effect size, this endpoint estimates the sample size and duration of an A/B test based on historical traffic. | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
title: estimateABTestRequest | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
configuration: | ||
title: estimateConfiguration | ||
type: object | ||
description: A/B test configuration for estimating the sample size and duration using minimum detectable effect. | ||
properties: | ||
outliers: | ||
$ref: '../common/schemas/ABTest.yml#/Outliers' | ||
emptySearch: | ||
$ref: '../common/schemas/ABTest.yml#/EmptySearch' | ||
minimumDetectableEffect: | ||
$ref: '../common/schemas/ABTest.yml#/MinimumDetectableEffect' | ||
required: | ||
- minimumDetectableEffect | ||
variants: | ||
type: array | ||
description: A/B test variants. | ||
minItems: 2 | ||
maxItems: 2 | ||
items: | ||
$ref: '../common/schemas/AddABTestsVariant.yml#/AddABTestsVariant' | ||
required: | ||
- configuration | ||
- variants | ||
responses: | ||
'200': | ||
description: OK | ||
headers: | ||
x-ratelimit-limit: | ||
$ref: '../../common/responses/rateLimit.yml#/x-ratelimit-limit' | ||
x-ratelimit-remaining: | ||
$ref: '../../common/responses/rateLimit.yml#/x-ratelimit-remaining' | ||
x-ratelimit-reset: | ||
$ref: '../../common/responses/rateLimit.yml#/x-ratelimit-reset' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../common/schemas/EstimateABTestResponse.yml#/EstimateABTestResponse' | ||
'400': | ||
$ref: '../../common/responses/BadRequest.yml' | ||
'402': | ||
$ref: '../../common/responses/FeatureNotEnabled.yml' | ||
'403': | ||
$ref: '../../common/responses/MethodNotAllowed.yml' | ||
'404': | ||
$ref: '../../common/responses/IndexNotFound.yml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[ | ||
{ | ||
"testName": "estimate AB Test sample size", | ||
"parameters": { | ||
"configuration": { | ||
"emptySearch": { | ||
"exclude": true | ||
}, | ||
"minimumDetectableEffect": { | ||
"size": 0.03, | ||
"metric": "conversionRate" | ||
} | ||
}, | ||
"variants": [ | ||
{ | ||
"index": "AB_TEST_1", | ||
"trafficPercentage": 50 | ||
}, | ||
{ | ||
"index": "AB_TEST_2", | ||
"trafficPercentage": 50 | ||
} | ||
] | ||
}, | ||
"request": { | ||
"path": "/2/abtests/estimate", | ||
"method": "POST", | ||
"body": { | ||
"configuration": { | ||
"emptySearch": { | ||
"exclude": true | ||
}, | ||
"minimumDetectableEffect": { | ||
"size": 0.03, | ||
"metric": "conversionRate" | ||
} | ||
}, | ||
"variants": [ | ||
{ | ||
"index": "AB_TEST_1", | ||
"trafficPercentage": 50 | ||
}, | ||
{ | ||
"index": "AB_TEST_2", | ||
"trafficPercentage": 50 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to reference it in the base spec file
api-clients-automation/specs/abtesting/spec.yml
Line 87 in efa672a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I did this locally and forgot to push before I left for the day. I'll send it tomorrow 👍