Skip to content

Commit efa672a

Browse files
committed
feat: add estimate path and responses
1 parent f29dfa7 commit efa672a

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

specs/abtesting/common/parameters.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,22 @@ filterEffects:
137137
type: integer
138138
description: Number of tracked searches removed from the A/B test.
139139
example: 237
140+
141+
minimumDetectableEffect:
142+
type: object
143+
properties:
144+
durationDays:
145+
type: number
146+
format: int64
147+
description: Estimated number of days needed to reach the sample sizes required for detecting the configured effect. This value is based on historical traffic.
148+
example: 21
149+
controlSampleSize:
150+
type: number
151+
format: int64
152+
description: Number of tracked searches needed to be able to detect the configured effect for the control variant.
153+
example: 23415
154+
experimentSampleSize:
155+
type: number
156+
format: int64
157+
description: Number of tracked searches needed to be able to detect the configured effect for the experiment variant.
158+
example: 23415
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
EstimateResponse:
2+
$ref: '../parameters.yml#/minimumDetectableEffect'

specs/abtesting/paths/estimate.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
post:
2+
tags:
3+
- abtest
4+
operationId: estimateABTest
5+
x-acl:
6+
- analytics
7+
summary: Estimate the sample size and duration of an A/B test
8+
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.
9+
requestBody:
10+
required: true
11+
content:
12+
application/json:
13+
schema:
14+
title: estimateABTestRequest
15+
type: object
16+
additionalProperties: false
17+
properties:
18+
configuration:
19+
$ref: '../common/schemas/ABTest.yml#/ABTestConfiguration'
20+
variants:
21+
type: array
22+
description: A/B test variants.
23+
minItems: 2
24+
maxItems: 2
25+
items:
26+
$ref: '../common/schemas/AddABTestsVariant.yml#/AddABTestsVariant'
27+
required:
28+
- configuration
29+
- variants
30+
responses:
31+
'200':
32+
description: OK
33+
headers:
34+
x-ratelimit-limit:
35+
$ref: '../../common/responses/rateLimit.yml#/x-ratelimit-limit'
36+
x-ratelimit-remaining:
37+
$ref: '../../common/responses/rateLimit.yml#/x-ratelimit-remaining'
38+
x-ratelimit-reset:
39+
$ref: '../../common/responses/rateLimit.yml#/x-ratelimit-reset'
40+
content:
41+
application/json:
42+
schema:
43+
$ref: '../common/schemas/EstimateResponse.yml#/EstimateResponse'
44+
'400':
45+
$ref: '../../common/responses/BadRequest.yml'
46+
'402':
47+
$ref: '../../common/responses/FeatureNotEnabled.yml'
48+
'403':
49+
$ref: '../../common/responses/MethodNotAllowed.yml'
50+
'404':
51+
$ref: '../../common/responses/IndexNotFound.yml'

0 commit comments

Comments
 (0)