Skip to content

Commit

Permalink
feat: add estimate path and responses
Browse files Browse the repository at this point in the history
  • Loading branch information
cdhawke committed Oct 30, 2024
1 parent f29dfa7 commit efa672a
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
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:
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'

0 comments on commit efa672a

Please sign in to comment.