Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  1. Start WSO2 BAM server with default settings.
  2. Go to 'WSO2_BAM_HOME/samples/kpi-definition/' directory
  3. Type 'ant' with in the directory from the console(This publishes the events to BAM)

Published event format (Stream stream definition)

Code Block
{
 "name" : "org.wso2.bam.phone.retail.store.kpi",
 "version" : "1.0.0",
 "nickName" : "Phone_Retail_Shop",
 "description" : "Phone Sales",
 "metaData" : [
        { "name" : "clientType",
          "type" : "STRING"
        } ],
 "payloadData" : [
        { "name" : "brand",
          "type" : "STRING"
        },
        { "name" : "quantity",
          "type" : "INT"        },
       { "name" : "total",
         "type" : "INT"       },
       { "name" : "user",
         "type" : "STRING"
       }] 
}

A Sample data 

 

Code Block
Event{
   streamId = 'org.wso2.bam.phone.retail.store.kpi-1.0.0-97c75175-776d-4732-aa21-1b901c15778f',
   timeStamp = 1343723606667,
   metaData = [external],
   correlationData = null,
   payloadData = [Nokia, 2, 140000, Harry] 
} 

...

4. Go to management console and login

5. Go to Main -> BAM Toolbox -> Add. Select 'Phone Retail Store Toolbox' and click on Install button. 

6.  Go to Main -> BAM Toolbox -> List. Wait until the 'KPI_Phone_Retail_Store' toolbox status changes to Installed.

...

Sales summary by customers 

 

Warning
iconfalse

The Hive script associated with the default KPI Monitoring sample has Cassandra port set as 9160. If you change the port offset, you should manually change the Cassandra port as well by following these steps:

  1. After installing the tool box, log in to the management console, select List sub menu under Analytics menu. This will open the Available Scripts window.
  2. Set "cassandra.port" = "9161" in the phone_retail_store_script and Save.