Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
themeRDark
titleRequest 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
themeRDark
titleDeviceType 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:


FieldtypeDescription
1
experiment_id
expIdStringunique id for experiment
2
experiment_name
expNameStringname of the experiment
3
client
expDescriptionString
experiment channel(portal/app/Desktop)start date
descirption of the experiment
4
start_dateTimestamp
expDataMap<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_date
createdBy
Timestamp
String
end date of
name of the user who created the experiment
6
user_count
updatedBy
Long
String
no of users mapped to
name of product that last updated the experiment
7
device_countno of devices mapped to the experiment
udpatedOn
Long
Timestamplast udpated date by the source
8
experiment_mapped
createdOn
Booleanflag to check if
Timestampcreated date for the experiment
is already mapped
9
udpated_onTimestamplast udpated by the experiement data product
criteriaMap<String,String>

criteria of the experiment

  • type  - Type of Criteria (user/device)
  • filters - Array of Filters
10statusStringstatus of the experiment(
active/inactivename of the user who created the experiment
SUBMITTED/PROCESSING/ACTIVE/FAILED/STOPPED/INACTIVE)
11status_messageStringstatus description of the experiment
12created_byString
11statsMap<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

Inputs

  • Experiment_Definition Cassandra Table
  • Experiment Criteria Config

...