Skip to content
19 changes: 19 additions & 0 deletions specs/abtesting/common/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,22 @@ filterEffects:
type: integer
description: Number of tracked searches removed from the A/B test.
example: 237

minimumDetectableEffect:
type: object
properties:
durationDays:
type: number
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: number
format: int64
description: Number of tracked searches needed to be able to detect the configured effect for the control variant.
example: 23415
experimentSampleSize:
type: number
format: int64
description: Number of tracked searches needed to be able to detect the configured effect for the experiment variant.
example: 23415
2 changes: 2 additions & 0 deletions specs/abtesting/common/schemas/EstimateResponse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EstimateResponse:
$ref: '../parameters.yml#/minimumDetectableEffect'
51 changes: 51 additions & 0 deletions specs/abtesting/paths/estimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
post:
Copy link
Member

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

so that it gets generated

Copy link
Contributor Author

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 👍

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:
$ref: '../common/schemas/ABTest.yml#/ABTestConfiguration'
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/EstimateResponse.yml#/EstimateResponse'
'400':
$ref: '../../common/responses/BadRequest.yml'
'402':
$ref: '../../common/responses/FeatureNotEnabled.yml'
'403':
$ref: '../../common/responses/MethodNotAllowed.yml'
'404':
$ref: '../../common/responses/IndexNotFound.yml'
Loading