function parseFlowSeriesDataForOracleStats (dataObj, callback) {
    var stats = dataObj.data;
    var timeObj = dataObj.timeObj;
    var context = dataObj.context;
    var resultJSON = [];
    var results = {};
    var statsLen = 0;
    var props = global.STATS_PROP[context];
    try {
        statsLen = stats.length;
    } catch(e) {
        statsLen = 0;
    }
    for (var i = 0; i < statsLen; i++) {
        var obj = {};
        obj.time = stats[i]["T="];
        obj.inBytes = commonUtils.ifNull(stats[i][props.inBytes], 0);
        obj.outBytes = commonUtils.ifNull(stats[i][props.outBytes], 0);
        obj.inPkts = commonUtils.ifNull(stats[i][props.inPkts], 0);
        obj.outPkts = commonUtils.ifNull(stats[i][props.outPkts], 0);
        obj.totalPkts = obj.inPkts + obj.outPkts;
        obj.totalBytes = obj.inBytes + obj.outBytes;
        resultJSON[i] = obj;
    }
    /* Now Sort the data */
    resultJSON.sort(sortFlowSeriesDataByTS);
    results.summary = {};
    results.summary.start_time = timeObj.start_time;
    results.summary.end_time = timeObj.end_time;
    results.summary.timeGran_microsecs =
        Math.floor(parseInt(timeObj.timeGran)) * global.MILLISEC_IN_SEC *
        global.MICROSECS_IN_MILL;
    results["flow-series"] = resultJSON;
    callback(null, results);
}
/*
 * Function used to parse the stats oracle response for both virtual network and virtual machine
 */
Function used to parse the stats oracle response for both virtual network and virtual machine
Function used to parse the stats oracle response for both virtual network and virtual machine
function parseFlowSeriesDataForOracleStats (dataObj, callback) {
    var stats = dataObj.data;
    var timeObj = dataObj.timeObj;
    var context = dataObj.context;
    var resultJSON = [];
    var results = {};
    var statsLen = 0;
    var props = global.STATS_PROP[context];
    try {
        statsLen = stats.length;
    } catch(e) {
        statsLen = 0;
    }
    for (var i = 0; i < statsLen; i++) {
        var obj = {};
        obj.time = stats[i]["T="];
        obj.inBytes = commonUtils.ifNull(stats[i][props.inBytes], 0);
        obj.outBytes = commonUtils.ifNull(stats[i][props.outBytes], 0);
        obj.inPkts = commonUtils.ifNull(stats[i][props.inPkts], 0);
        obj.outPkts = commonUtils.ifNull(stats[i][props.outPkts], 0);
        obj.totalPkts = obj.inPkts + obj.outPkts;
        obj.totalBytes = obj.inBytes + obj.outBytes;
        resultJSON[i] = obj;
    }
    resultJSON.sort(sortFlowSeriesDataByTS);
    results.summary = {};
    results.summary.start_time = timeObj.start_time;
    results.summary.end_time = timeObj.end_time;
    results.summary.timeGran_microsecs =
        Math.floor(parseInt(timeObj.timeGran)) * global.MILLISEC_IN_SEC *
        global.MICROSECS_IN_MILL;
    results["flow-series"] = resultJSON;
    callback(null, results);
}
function parseFlowSeriesDataForOracleStats ( dataObj , callback ) { var stats = dataObj . data ; var timeObj = dataObj . timeObj ; var context = dataObj . context ; var resultJSON = [ ] ; var results = { } ; var statsLen = 0 ; var props = global . STATS_PROP [ context ] ; try { statsLen = stats . length ; } catch ( e ) { statsLen = 0 ; } for ( var i = 0 ; i < statsLen ; i ++ ) { var obj = { } ; obj . time = stats [ i ] [ "T=" ] ; obj . inBytes = commonUtils . ifNull ( stats [ i ] [ props . inBytes ] , 0 ) ; obj . outBytes = commonUtils . ifNull ( stats [ i ] [ props . outBytes ] , 0 ) ; obj . inPkts = commonUtils . ifNull ( stats [ i ] [ props . inPkts ] , 0 ) ; obj . outPkts = commonUtils . ifNull ( stats [ i ] [ props . outPkts ] , 0 ) ; obj . totalPkts = obj . inPkts + obj . outPkts ; obj . totalBytes = obj . inBytes + obj . outBytes ; resultJSON [ i ] = obj ; } resultJSON . sort ( sortFlowSeriesDataByTS ) ; results . summary = { } ; results . summary . start_time = timeObj . start_time ; results . summary . end_time = timeObj . end_time ; results . summary . timeGran_microsecs = Math . floor ( parseInt ( timeObj . timeGran ) ) * global . MILLISEC_IN_SEC * global . MICROSECS_IN_MILL ; results [ "flow-series" ] = resultJSON ; callback ( null , results ) ; }
Function used to parse the stats oracle response for both virtual network and virtual machine
Function used to parse the stats oracle response for both virtual network and virtual machine
/* Now Sort the data */