-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(specs): add estimate path and responses [skip-bc] (#4057)
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
- Loading branch information
Showing
5 changed files
with
140 additions
and
4 deletions.
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 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] |