use of com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram in project pinpoint by naver.
the class DFSLinkSelector method fillEmulationLink.
private void fillEmulationLink(LinkDataDuplexMap linkDataDuplexMap) {
// TODO need to be reimplemented - virtual node creation logic needs an overhaul.
// Currently, only the reversed relationship node is displayed. We need to create a virtual node and convert the rpc data appropriately.
logger.debug("this.emulationLinkMarker:{}", this.emulationLinkMarker);
List<LinkData> emulationLinkDataList = findEmulationLinkData(linkDataDuplexMap);
for (LinkData emulationLinkData : emulationLinkDataList) {
LinkCallDataMap beforeImage = emulationLinkData.getLinkCallDataMap();
logger.debug("beforeImage:{}", beforeImage);
emulationLinkData.resetLinkData();
LinkKey findLinkKey = new LinkKey(emulationLinkData.getFromApplication(), emulationLinkData.getToApplication());
LinkData targetLinkData = linkDataDuplexMap.getTargetLinkData(findLinkKey);
if (targetLinkData == null) {
// There has been a case where targetLinkData was null, but exact event could not be captured for analysis.
// Logging the case for further analysis should it happen again in the future.
logger.error("targetLinkData not found findLinkKey:{}", findLinkKey);
continue;
}
// create reversed link data - convert data accepted by the target to target's call data
LinkCallDataMap targetList = targetLinkData.getLinkCallDataMap();
Collection<LinkCallData> beforeLinkDataList = beforeImage.getLinkDataList();
LinkCallData beforeLinkCallData = beforeLinkDataList.iterator().next();
for (LinkCallData agentHistogram : targetList.getLinkDataList()) {
Collection<TimeHistogram> timeHistogramList = agentHistogram.getTimeHistogram();
LinkCallDataMap linkCallDataMap = emulationLinkData.getLinkCallDataMap();
if (logger.isDebugEnabled()) {
logger.debug("emulationLink BEFORE:{}", beforeLinkCallData);
logger.debug("emulationLink agent:{}", agentHistogram);
logger.debug("emulationLink link:{}/{} -> {}/{}", agentHistogram.getTarget(), agentHistogram.getTargetServiceType(), beforeLinkCallData.getTarget(), beforeLinkCallData.getTargetServiceType().getCode());
}
linkCallDataMap.addCallData(agentHistogram.getTarget(), agentHistogram.getTargetServiceType(), beforeLinkCallData.getTarget(), beforeLinkCallData.getTargetServiceType(), timeHistogramList);
}
}
}
use of com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram in project pinpoint by naver.
the class LinkCallData method addCallData.
public void addCallData(Collection<TimeHistogram> timeHistogramList) {
for (TimeHistogram timeHistogram : timeHistogramList) {
TimeHistogram histogram = getTimeHistogram(timeHistogram.getTimeStamp());
histogram.add(timeHistogram);
}
}
use of com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram in project pinpoint by naver.
the class LinkCallData method getTimeHistogram.
private TimeHistogram getTimeHistogram(Long timeStamp) {
long key = timeWindow != null ? timeWindow.refineTimestamp(timeStamp) : timeStamp;
TimeHistogram histogram = targetHistogramTimeMap.get(key);
if (histogram == null) {
histogram = new TimeHistogram(targetServiceType, key);
targetHistogramTimeMap.put(key, histogram);
}
return histogram;
}
use of com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram in project pinpoint by naver.
the class LinkCallData method addRawCallData.
public void addRawCallData(LinkCallData copyLinkCallData) {
Objects.requireNonNull(copyLinkCallData, "copyLinkCallData");
if (!this.source.equals(copyLinkCallData.source)) {
throw new IllegalArgumentException("source not equals");
}
if (this.sourceServiceType != copyLinkCallData.sourceServiceType) {
throw new IllegalArgumentException("sourceServiceType not equals");
}
if (!this.target.equals(copyLinkCallData.target)) {
throw new IllegalArgumentException("target not equals");
}
if (this.targetServiceType != copyLinkCallData.targetServiceType) {
throw new IllegalArgumentException("targetServiceType not equals");
}
for (Map.Entry<Long, TimeHistogram> copyEntry : copyLinkCallData.targetHistogramTimeMap.entrySet()) {
final Long timeStamp = copyEntry.getKey();
TimeHistogram histogram = getTimeHistogram(timeStamp);
histogram.add(copyEntry.getValue());
}
}
use of com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram in project pinpoint by naver.
the class VirtualLinkHandler method fillEmulationLink.
private void fillEmulationLink(LinkDataDuplexMap linkDataDuplexMap, Set<LinkData> emulationLinkMarker) {
// TODO need to be reimplemented - virtual node creation logic needs an overhaul.
// Currently, only the reversed relationship node is displayed. We need to create a virtual node and convert the rpc data appropriately.
logger.debug("this.emulationLinkMarker:{}", emulationLinkMarker);
List<LinkData> emulationLinkDataList = findEmulationLinkData(linkDataDuplexMap, emulationLinkMarker);
for (LinkData emulationLinkData : emulationLinkDataList) {
LinkCallDataMap beforeImage = emulationLinkData.getLinkCallDataMap();
logger.debug("beforeImage:{}", beforeImage);
emulationLinkData.resetLinkData();
LinkKey findLinkKey = new LinkKey(emulationLinkData.getFromApplication(), emulationLinkData.getToApplication());
LinkData targetLinkData = linkDataDuplexMap.getTargetLinkData(findLinkKey);
if (targetLinkData == null) {
// There has been a case where targetLinkData was null, but exact event could not be captured for analysis.
// Logging the case for further analysis should it happen again in the future.
logger.error("targetLinkData not found findLinkKey:{}", findLinkKey);
continue;
}
// create reversed link data - convert data accepted by the target to target's call data
LinkCallDataMap targetList = targetLinkData.getLinkCallDataMap();
Collection<LinkCallData> beforeLinkDataList = beforeImage.getLinkDataList();
LinkCallData beforeLinkCallData = beforeLinkDataList.iterator().next();
for (LinkCallData agentHistogram : targetList.getLinkDataList()) {
Collection<TimeHistogram> timeHistogramList = agentHistogram.getTimeHistogram();
LinkCallDataMap linkCallDataMap = emulationLinkData.getLinkCallDataMap();
if (logger.isDebugEnabled()) {
logger.debug("emulationLink BEFORE:{}", beforeLinkCallData);
logger.debug("emulationLink agent:{}", agentHistogram);
logger.debug("emulationLink link:{}/{} -> {}/{}", agentHistogram.getTarget(), agentHistogram.getTargetServiceType(), beforeLinkCallData.getTarget(), beforeLinkCallData.getTargetServiceType().getCode());
}
linkCallDataMap.addCallData(agentHistogram.getTarget(), agentHistogram.getTargetServiceType(), beforeLinkCallData.getTarget(), beforeLinkCallData.getTargetServiceType(), timeHistogramList);
}
}
}
Aggregations