Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Purpose :

  • Design for Create Experiment API to populate the experiment definition
  • Design the experiment definition schema
  • Data product design to map  the experiment to users/devices based on criteria

Design Flow :

Experiment Create API :

 URL :  POST  /experiment/create

Input :

User Criteria Input Request:

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:

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:


FieldtypeDescription
1expIdStringunique id for experiment
2expNameStringname of the experiment
3expDescriptionStringdescirption of the experiment
4expDataMap<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
5createdByStringname of the user who created the experiment
6updatedByStringname of product that last updated the experiment
7udpatedOnTimestamplast udpated date by the source
8createdOnTimestampcreated date for the experiment
9criteriaMap<String,String>

criteria of the experiment

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

Input:

  • Experiment_Definition Cassandra Table

Output 

User experiment mapping  index to elastic search

Experiment Index
User Experiment :
{
          "name" : "USER_ORG",
          "expType" : "user",
          "lastUpdatedOn" : "2019-07-30T00:00:00",
          "endDate" : "2019-07-28T00:00:00",
          "url" : null,
          "deviceIdMod" : 0,
          "key" : "2392438420",
          "id" : "A1234",
          "userIdMod" : 0,
          "userId" : "d5fd92df-2683-4357-8620-45bc0683f38c",
          "platform" : "portal",
          "deviceId" : null,
          "startDate" : "2019-07-25T00:00:00"
        }

Device Experiment :

{
          "name" : "DEVICE_LOCATION",
          "expType" : "device",
          "lastUpdatedOn" : "2019-07-30T00:00:00",
          "endDate" : "2019-08-30T00:00:00",
          "url" : null,
          "deviceIdMod" : 0,
          "key" : "4584583045489",
          "id" : "B1534",
          "userIdMod" : 0,
          "userId" : null,
          "platform" : "app",
          "deviceId" : "3f3da025f07f2d6e4ead9042710b8b78",
          "startDate" : "2019-07-29T00:00:00"
        }




  • No labels