Purpose :
- Design for Create Experiment API to populate the experiment definition
- Design the experiment definition metadata schema
- Data product design to populate experiment data for the experiments
Design Flow :
...
- to map the experiment to users/devices based on criteria
Design Flow :
Image Added Experiment Create API :
URL : POST /experiment/create
Input :
User Criteria Input Request:
Code Block |
---|
theme | RDark |
---|
title | Request Body |
---|
|
"request": {
"expId": "U1234", // Unique Id for Experiment
"name": "USER_ORG", // Name for Experiment
"createdBy": "User1", // Name of the user who created this experiment
"description": "Experiment to get users with orgname = sunbird", // Short Description about the experiment
"criteria": { // Criteria for the Experiment
"type": "user", // Type of the Criteria
"filters": { // Array of Filters Criteria with User Filter field Name and List of Values
"organisations.orgName": ["sunbird"] // List of Values
}
},
"data" : { // Experiment Data
"startDate" : "2019-08-01", // Start date of the Experiment
"endDate" : "2019-08-02", // End date of the Experiment
"key" : "/org/profile" // Experiment Key
}
} |
Device Criteria Input Request:
Code Block |
---|
theme | RDark |
---|
title | DeviceType Criteria Request Body |
---|
|
"request": {
"expId": "D1234", // Unique Id for Experiment
"name": "Device_STATE_AP", // Name for Experiment
"createdBy": "User2", // Name of the user who created this experiment
"description": "Experiment to get devices with state = AndhraPradesh", // Short Description about the experiment
"criteria": { // Criteria for the Experiment
"type": "device", // Type of the Criteria
"filters": { // Array of Filters
"name": "state", // Name of the field
"operator": "IN", // Filter Operator
"value": ["Karnataka"] // List of Values
}
},
"data" : { // Experiment Data
"startDate" : "2019-08-01", // Start date of the Experiment
"endDate" : "2019-08-02", // End date of the Experiment
"key" : "3fksjfksdlfj", // Experiment Key
"client" : "app" // T
}
} |
Output :
- Process the request and save the request parameters to Experiment-Definition Cassandra Table with status "SUBMITTED"
- Response : "Experiment Submitted Sucessfully"
Experiment Definition Schema:
experiment_idexpId | String | unique id for experiment |
2 |
experiment_nameexpName | String | name of the experiment |
3 |
clientexperiment channel(portal/app/Desktop)start date descirption of the experiment |
4 |
start_date | Timestamp | expData | Map<String,String> | Experiment Data - startDate - start date of the experiment
- endDate - end date of the experiment
- key/url - key or url of the experiment
- modulus - mod number of the experiment
|
5 |
end_dateTimestampend date of name of the user who created the experiment |
6 |
user_countLongno of users mapped to name of product that last updated the experiment |
7 |
device_countno of devices mapped to the experimentLong | Timestamp | last udpated date by the source |
8 |
experiment_mappedBoolean | flag to check if Timestamp | created date for the experiment |
is already mappedudpated_on | Timestamp | last udpated by the experiement data productcriteria | Map<String,String> | criteria of the experiment - type - Type of Criteria (user/device)
- filters - Array of Filters
|
10 | status | String | status of the experiment( |
active/inactivename of the user who created the experimentSUBMITTED/PROCESSING/ACTIVE/FAILED/STOPPED/INACTIVE) |
11 | status_message | String | status description of the experiment |
12 | created_by | String | 11 | stats | Map<String,Long> | Statistic Data - usersMatched
- devicesMatched
|
Experiment Data Product :
Purpose
- To compute the user experiment mapping based on the experiment criteria and save it to elastic search
- Experiment_Definition Cassandra Table
- Experiment Criteria Config
...