Application Metrics Collection Project Template
Composer provides Project templates for Genesys Voice Platform voice applications (File > New > Java Composer Project):
In this template, added in 8.1.440.18, JavaScript metrics.js files capture and build metrics data in JSON format. The Logging Details property in the callflow diagram blocks are used to call the JavaScript methods. Diagrams are designed to use VAR blocks to provide insights on capturing VAR data. In addition to Project-specific files in the include, META-INFO, and scripts folders, the Project includes the following diagrams in the Callflows folder:
[+] Metrics.callflow
Main JS Methods:
- initReportingData - Initialize metrics object for each diagram file
- finalizeReportingData - Finalize the reporting data with latest set of variables
- storeMetric - Method to build metrics
- getReportData - Method to get final report in JSON format
Logging Details Properties for Metrics.callflow Calling the JavaScript Methods:
StartApp block Logging Details
initReportingData(new Object(), AppState.varAppID, AppState.varAppName, AppState.varAppVersion)
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'Entry','StartApp',{})
Main Application Start block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'VAR','MainAppActionStart',{});
storeMetric(gMETRICS.ACTIVITY_START, 'VAR','MainAppActionStart',{'actionId':AppState.varMainAction,'parentAction':'MainMetrics'});
Main Menu block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'MENU','MainMenu',{});
SubHandleSales block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'SUBDIALOG','SubHandleSales',{})
storeMetric(gMETRICS.APP_MILESTONES, 'SUBDIALOG','SubHandleSales','Main menu passed')
SubHandleService block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'SUBDIALOG','SubHandleService',{})
Merge Metrics block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'SCRIPT','MergeMetrics',{});
storeMetric(gMETRICS.APP_MILESTONES, 'SCRIPT','MergeMetris','Sub dialogs passed')
SetCallDataAfterSub block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'CALLDATA','SetCallDataAfterSub',{})
storeMetric(gMETRICS.CALL_DATA, 'CALLDATA','SetCallDataAfterSub',{'CustomVar0':AppState.varSubResult,'CustomVar1':AppState.varMainMenu,'CustomVar2':AppState.ANI,'CustomVar3':AppState.DNIS,'CustomVar4':AppState.APP_LANGUAGE,'CustomVar5':AppState.varAppID})
BranchforAssistance block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'BRANCHING','BranchForAssistance',{})
storeMetric(gMETRICS.APP_MILESTONES, 'BRANCHING','BranchForAssistance','Main branching passed')
QueueTheCall block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'ROUTEREQUEST','QueueTheCall',{})
MainAppActionEnd block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'VAR','MainAppActionEnd',{});
storeMetric(gMETRICS.ACTIVITY_END, 'VAR', 'MainAppActionEnd', {'actionId':AppState.varMainAction,'notes':'','reason':'','result':''});
PostMetricsData block
Json Content property, content placed in a variable.
[+] sub_sales.callflow
Start the subdialog application. Re-initialize the metrics object and return back to the main for merge.
Logging Details Properties for sub_sales.callflow that Call the JavaScript Methods:
StartSalesSubApp block Logging Details
initReportingData(new Object(), AppState.varAppID, AppState.varAppName, AppState.varAppVersion)
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'ENTRY','StartSalesSubApp',{});
SubSalesApplicationStart block Logging Details
storeMetric(gMETRICS.APP_MILESTONES, 'VAR','SubSalesAppActionStart','Sub dialog sales start')
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'VAR','SubSalesAppActionStart',{})
storeMetric(gMETRICS.ACTIVITY_START, 'VAR','SubSalesAppActionStart',{'actionId':AppState.varSubSalesAction,'parentAction':'SubSales'});
SubSalesSetCall Data block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'CALLDATA','SubSalesSetCallData',{})
storeMetric(gMETRICS.CALL_DATA, 'CALLDATA','SubSalesSetCallData',{'CustomVar2':AppState.ANI,'CustomVar3':AppState.DNIS,'CustomVar4':AppState.APP_LANGUAGE})
SubSalesAppActionEnd block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'VAR','SubSalesAppActionEnd',{});
storeMetric(gMETRICS.ACTIVITY_END, 'VAR', 'SubSalesAppActionEnd', {'actionId':AppState.varSubSalesAction,'notes':'','reason':'','result':''});
storeMetric(gMETRICS.APP_MILESTONES, 'VAR','SubSalesAppActionStart','Sub Sales service end')
[+] sub_service.callflow
Start the subdialog application. Re-initialize the metrics object and return back to the main for merge.
Logging Details Properties for sub_service.callflow Calling the JavaScript Methods:
StartServiceSubApp block Logging Details
initReportingData(new Object(), AppState.varAppID, AppState.varAppName, AppState.varAppVersion)
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'ENTRY','StartserviceSubApp',{});
SubServiceApplicationStart block Logging Details
storeMetric(gMETRICS.APP_MILESTONES, 'VAR','SubserviceAppActionStart','Sub dialog service start')
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'VAR','SubserviceAppActionStart',{})
storeMetric(gMETRICS.ACTIVITY_START, 'VAR','SubserviceAppActionStart',{'actionId':AppState.varSubserviceAction,'parentAction':'Subservice'})
SubServiceSetCall Data block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'CALLDATA','SubserviceSetCallData',{})
storeMetric(gMETRICS.CALL_DATA, 'CALLDATA','SubserviceSetCallData',{'CustomVar2':AppState.ANI,'CustomVar3':AppState.DNIS,'CustomVar4':AppState.APP_LANGUAGE})
SubServiceAppActionEnd block Logging Details
storeMetric(gMETRICS.BLOCK_ENTRY_TIME, 'VAR','SubserviceAppActionEnd',{});
storeMetric(gMETRICS.ACTIVITY_END, 'VAR', 'SubserviceAppActionEnd', {'actionId':AppState.varSubserviceAction,'notes':'','reason':'','result':''});
storeMetric(gMETRICS.APP_MILESTONES, 'VAR','SubserviceAppActionStart','Sub dialog service end')
[+] sample data
.
{
"externalrequests": [],
"dtmfpath": "0",
"milestones": ["Main menu passed", "Sub dialogs passed", "Sub dialog sales start", "Sub Sales service end", "Main branching passed"],
"activities": [{
"activity": "Main Application",
"parent": "MainMetrics",
"entry": {
"blockName": "MainAppActionStart",
"time": "2017-01-31T23:55:24.823Z"
},
"exit": {
"blockName": "MainAppActionEnd",
"time": "2017-01-31T23:56:01.250Z"
},
"notes": "",
"reason": "",
"result": "",
"seq": 1
}, {
"activity": "Subdialog for Sales",
"parent": "SubSales",
"entry": {
"blockName": "SubSalesAppActionStart",
"time": "2017-01-31T23:55:23.615Z"
},
"exit": {
"blockName": "SubSalesAppActionEnd",
"time": "2017-01-31T23:55:23.615Z"
},
"notes": "",
"reason": "",
"result": "",
"seq": 2
}],
"menucount": 1,
"inputcount": 0,
"variables": {
"System": "{\"RetainInputTypeVariableDefaultValue\":false}",
"ANI": "4444",
"DNIS": "dialog",
"USE_LCASE_USERDATAKEY": "0",
"GVPSessionID": "undefined",
"g_CTICCall": "false",
"APP_ASR_LANGUAGE": "en-US",
"APP_LANGUAGE": "en-US",
"COMPOSER_WSSTUBBING": "0",
"EnableFCR": "true",
"EnableReports": "false",
"EnableSNMP": "false",
"GRAMMARFILEDIR": "../Resources/Grammars",
"LAST_EVENT_ELEMENT": "undefined",
"LAST_EVENT_LINE": "undefined",
"LAST_EVENT_MSG": "undefined",
"LAST_EVENT_NAME": "undefined",
"LAST_EVENT_URL": "undefined",
"PREV_APP_ASR_LANGUAGE": "undefined",
"PREV_APP_LANGUAGE": "undefined",
"SCRIPTSDIR": "../Scripts",
"varAppID": "b9768280-f518-11e5-9481-a98d7c98c257",
"varAppName": "MetricsDemo",
"varAppVersion": "1.0",
"varMainAction": "Main Application",
"varMainMenu": "0",
"VOXFILEDIR": "../Resources/Prompts",
"varQueueDN": "1234",
"varSubResult": "false",
"varCollectSubMetric": ""
},
"blocks": [{
"type": "Entry",
"name": "StartApp",
"entry_time": "2017-01-31T23:55:23.615Z"
}, {
"type": "EXIT",
"name": "SubSalesExit",
"entry_time": "2017-01-31T23:55:23.615Z"
}, {
"type": "VAR",
"name": "MainAppActionStart",
"entry_time": "2017-01-31T23:55:24.576Z"
}, {
"type": "MENU",
"name": "MainMenu",
"entry_time": "2017-01-31T23:55:26.073Z"
}, {
"type": "ENTRY",
"name": "StartSalesSubApp",
"entry_time": "2017-01-31T23:55:23.615Z"
}, {
"type": "VAR",
"name": "SubSalesAppActionStart",
"entry_time": "2017-01-31T23:55:23.615Z"
}, {
"type": "CALLDATA",
"name": "SubSalesSetCallData",
"entry_time": "2017-01-31T23:55:23.615Z"
}, {
"type": "VAR",
"name": "SubSalesAppActionEnd",
"entry_time": "2017-01-31T23:55:23.615Z"
}, {
"type": "SUBDIALOG",
"name": "SubHandleSales",
"entry_time": "2017-01-31T23:55:38.228Z"
}, {
"type": "SCRIPT",
"name": "MergeMetrics",
"entry_time": "2017-01-31T23:55:54.163Z"
}, {
"type": "CALLDATA",
"name": "SetCallDataAfterSub",
"entry_time": "2017-01-31T23:55:55.360Z"
}, {
"type": "VAR",
"name": "MainAppActionEnd",
"entry_time": "2017-01-31T23:56:00.988Z"
}, {
"type": "BRANCHING",
"name": "BranchForAssistance",
"entry_time": "2017-01-31T23:55:59.547Z"
}, {
"type": "EXIT",
"name": "MetricsMainExit",
"entry_time": "2017-01-31T23:56:02.941Z"
}],
"calldata": [{
"variables": "{\"CustomVar2\":\"4444\",\"CustomVar3\":\"dialog\",\"CustomVar4\":\"en-US\"}",
"entry": {
"blockName": "SubSalesSetCallData",
"time": 1485906946093
}
}, {
"variables": "{\"CustomVar0\":false,\"CustomVar1\":\"0\",\"CustomVar2\":\"4444\",\"CustomVar3\":\"dialog\",\"CustomVar4\":\"en-US\",\"CustomVar5\":\"b9768280-f518-11e5-9481-a98d7c98c257\"}",
"entry": {
"blockName": "SetCallDataAfterSub",
"time": 1485906955609
}
}],
"@timestamp": "2017-01-31T23:55:23.340Z",
"utcstart": 1485906923340,
"applicationID": "b9768280-f518-11e5-9481-a98d7c98c257",
"applicationName": "MetricsDemo",
"applicationVersion": "1.0",
"@endtime": "2017-01-31T23:56:03.177Z",
"duration": "39837",
"activitycount": 2,
"extreqcount": 0,
"udata": {
"Composer-Debug": "rItilZQ6wM"
}
}
For information about GVP metrics (VoiceXML and CCXML application event logs), see the
GVP 8.1 Metrics Reference Guide