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);
}
}
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);
}
}
}
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;
}
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);
}
Aggregations