Search in sources :

Example 1 with SessionValues

use of com.att.aro.core.packetanalysis.pojo.SessionValues in project VideoOptimzer by attdevsupport.

the class MultipleSimultnsConnImpl method populateAllSimultConnList.

private void populateAllSimultConnList() {
    List<Session> sessions = traceDataResult.getSessionlist();
    if (sessions == null || sessions.size() <= 0) {
        simultnsConnectionAllServersEntryList = Collections.emptyList();
        return;
    }
    List<Session> tempSessionList = new ArrayList<Session>();
    Map<String, ArrayList<Session>> distinctMap = simultnsUtil.getDistinctMap(sessions);
    for (Map.Entry<String, ArrayList<Session>> entry : distinctMap.entrySet()) {
        ArrayList<Session> tempList = entry.getValue();
        for (int iterator = 0; iterator < tempList.size(); iterator++) {
            tempSessionList.add(tempList.get(iterator));
        }
    }
    List<SessionValues> sessionValuesList = simultnsUtil.createDomainsTCPSessions(tempSessionList);
    MultipleConnectionsEntry simultnsConnEntry = simultnsUtil.getTimeMap(sessionValuesList, maxConnections, true);
    if (simultnsConnEntry != null) {
        simultnsConnectionAllServersEntryMap.put(simultnsConnEntry.getStartTimeStamp(), simultnsConnEntry);
    }
}
Also used : MultipleConnectionsEntry(com.att.aro.core.bestpractice.pojo.MultipleConnectionsEntry) ArrayList(java.util.ArrayList) TreeMap(java.util.TreeMap) Map(java.util.Map) SortedMap(java.util.SortedMap) Session(com.att.aro.core.packetanalysis.pojo.Session) SessionValues(com.att.aro.core.packetanalysis.pojo.SessionValues)

Example 2 with SessionValues

use of com.att.aro.core.packetanalysis.pojo.SessionValues in project VideoOptimzer by attdevsupport.

the class SimultnsConnImpl method populateSimultConnList.

private void populateSimultConnList() {
    List<Session> sessions = traceDataResult.getSessionlist();
    if (sessions == null || sessions.size() <= 0) {
        simultnsConnectionEntryList = Collections.emptyList();
        return;
    }
    Map<String, ArrayList<Session>> distinctMap = simultnsUtil.getDistinctMap(sessions);
    HashMap<String, List<SessionValues>> ipMap = new HashMap<String, List<SessionValues>>();
    for (Map.Entry<String, ArrayList<Session>> entry : distinctMap.entrySet()) {
        ArrayList<Session> tempList = entry.getValue();
        tempList.trimToSize();
        List<SessionValues> timeMap = simultnsUtil.createDomainsTCPSessions(tempList);
        ipMap.put(entry.getKey(), timeMap);
    }
    for (HashMap.Entry<String, List<SessionValues>> ipEntry : ipMap.entrySet()) {
        MultipleConnectionsEntry simultnsConnEntry = simultnsUtil.getTimeMap(ipEntry.getValue(), maxConnections, false);
        if (simultnsConnEntry != null) {
            simultnsConnectionEntryMap.put(simultnsConnEntry.getStartTimeStamp(), simultnsConnEntry);
        }
    }
}
Also used : MultipleConnectionsEntry(com.att.aro.core.bestpractice.pojo.MultipleConnectionsEntry) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) SessionValues(com.att.aro.core.packetanalysis.pojo.SessionValues) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) TreeMap(java.util.TreeMap) Map(java.util.Map) SortedMap(java.util.SortedMap) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 3 with SessionValues

use of com.att.aro.core.packetanalysis.pojo.SessionValues in project VideoOptimzer by attdevsupport.

the class SimultnsUtil method createDomainsTCPSessions.

public List<SessionValues> createDomainsTCPSessions(Collection<Session> allTCPSessions) {
    List<SessionValues> sessionValues = new ArrayList<SessionValues>();
    Session lastSession = null;
    for (Session aSession : allTCPSessions) {
        if (aSession != null) {
            if (!aSession.getRequestResponseInfo().isEmpty()) {
                for (HttpRequestResponseInfo req : aSession.getRequestResponseInfo()) {
                    sessionValues = addSessionValues(sessionValues, lastSession, aSession, req);
                    lastSession = aSession;
                }
            } else {
                HttpRequestResponseInfo reqResp = new HttpRequestResponseInfo();
                if (aSession.getRemoteHostName() != null) {
                    reqResp.setHostName(aSession.getRemoteHostName());
                    reqResp.setFirstDataPacket(aSession.getTcpPackets().get(0));
                }
                sessionValues = addSessionValues(sessionValues, lastSession, aSession, reqResp);
            }
        }
    }
    return sessionValues;
}
Also used : HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) ArrayList(java.util.ArrayList) SessionValues(com.att.aro.core.packetanalysis.pojo.SessionValues) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 4 with SessionValues

use of com.att.aro.core.packetanalysis.pojo.SessionValues in project VideoOptimzer by attdevsupport.

the class SimultnsUtil method getTimeMap.

public MultipleConnectionsEntry getTimeMap(List<SessionValues> tMap, int maxCount, boolean isManyServer) {
    String ipInside = "";
    String domainVal = "";
    TreeMap<Double, Double> timeMap = new TreeMap<Double, Double>();
    TreeMap<Double, HttpRequestResponseInfo> reqRespTimeMap = new TreeMap<Double, HttpRequestResponseInfo>();
    int iterator = 0;
    double sessionStartTime = 0.0;
    double sessionEndTime = 0.0;
    double[] start = new double[tMap.size()];
    double[] end = new double[tMap.size()];
    for (SessionValues indSessionVal : tMap) {
        sessionStartTime = indSessionVal.getStartTime();
        sessionEndTime = indSessionVal.getEndTime();
        timeMap.put(sessionStartTime, sessionEndTime);
        start[iterator] = sessionStartTime;
        end[iterator] = sessionEndTime;
        ipInside = indSessionVal.getIp().substring(indSessionVal.getIp().lastIndexOf('/') + 1, indSessionVal.getIp().length());
        ipMap.put(sessionStartTime, ipInside);
        if (indSessionVal.getReqRespInfo() != null) {
            HttpRequestResponseInfo reqResponseSessionData = indSessionVal.getReqRespInfo();
            if (reqResponseSessionData.getHostName() != null) {
                domainVal = reqResponseSessionData.getHostName();
            } else {
                domainVal = ipInside;
            }
            reqRespTimeMap.put(sessionStartTime, reqResponseSessionData);
        } else {
            reqRespTimeMap.put(sessionStartTime, new HttpRequestResponseInfo());
        }
        iterator++;
    }
    return maxOverlapIntervalCount(domainVal, start, end, maxCount, timeMap, isManyServer, reqRespTimeMap, ipInside);
}
Also used : HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) TreeMap(java.util.TreeMap) SessionValues(com.att.aro.core.packetanalysis.pojo.SessionValues)

Aggregations

SessionValues (com.att.aro.core.packetanalysis.pojo.SessionValues)4 Session (com.att.aro.core.packetanalysis.pojo.Session)3 ArrayList (java.util.ArrayList)3 TreeMap (java.util.TreeMap)3 MultipleConnectionsEntry (com.att.aro.core.bestpractice.pojo.MultipleConnectionsEntry)2 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)2 Map (java.util.Map)2 SortedMap (java.util.SortedMap)2 HashMap (java.util.HashMap)1 List (java.util.List)1