use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class SlowCountToCalleCheckerTest method checkTest2.
@Test
public void checkTest2() {
Application application = new Application(FROM_SERVICE_NAME, ServiceType.STAND_ALONE);
MapStatisticsCallerDataCollector dataCollector = new MapStatisticsCallerDataCollector(DataCollectorCategory.CALLER_STAT, application, dao, System.currentTimeMillis(), 300000);
Rule rule = new Rule(FROM_SERVICE_NAME, SERVICE_TYPE, CheckerCategory.SLOW_COUNT_TO_CALLEE.getName(), 8, "testGroup", false, false, TO_SERVICE_NAME + 1);
SlowCountToCalleeChecker checker = new SlowCountToCalleeChecker(dataCollector, rule);
checker.check();
assertFalse(checker.isDetected());
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class SlowRateToCalleCheckerTest method checkTest2.
@Test
public void checkTest2() {
Application application = new Application(FROM_SERVICE_NAME, ServiceType.STAND_ALONE);
MapStatisticsCallerDataCollector dataCollector = new MapStatisticsCallerDataCollector(DataCollectorCategory.CALLER_STAT, application, dao, System.currentTimeMillis(), 300000);
Rule rule = new Rule(FROM_SERVICE_NAME, SERVICE_TYPE, CheckerCategory.SLOW_RATE_TO_CALLEE.getName(), 71, "testGroup", false, false, TO_SERVICE_NAME + 1);
SlowRateToCalleeChecker checker = new SlowRateToCalleeChecker(dataCollector, rule);
checker.check();
assertFalse(checker.isDetected());
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class TotalCountToCalleeCheckerTest method checkTest3.
@Test
public void checkTest3() {
Application application = new Application(FROM_SERVICE_NAME, ServiceType.STAND_ALONE);
MapStatisticsCallerDataCollector dataCollector = new MapStatisticsCallerDataCollector(DataCollectorCategory.CALLER_STAT, application, dao, System.currentTimeMillis(), 300000);
Rule rule = new Rule(FROM_SERVICE_NAME, SERVICE_TYPE, CheckerCategory.TOTAL_COUNT_TO_CALLEE.getName(), 10, "testGroup", false, false, TO_SERVICE_NAME + 2);
TotalCountToCalleeChecker checker = new TotalCountToCalleeChecker(dataCollector, rule);
checker.check();
assertTrue(checker.isDetected());
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class FilteredMapServiceImpl method createMap.
private ApplicationMap createMap(Range range, Range scanRange, List<List<SpanBo>> filterList) {
// TODO inject TimeWindow from elsewhere
final TimeWindow window = new TimeWindow(range, TimeWindowDownSampler.SAMPLER);
final LinkDataDuplexMap linkDataDuplexMap = new LinkDataDuplexMap();
final ResponseHistogramBuilder mapHistogramSummary = new ResponseHistogramBuilder(range);
/*
* Convert to statistical data
*/
for (List<SpanBo> transaction : filterList) {
final Map<Long, SpanBo> transactionSpanMap = checkDuplicatedSpanId(transaction);
for (SpanBo span : transaction) {
final Application parentApplication = createParentApplication(span, transactionSpanMap);
final Application spanApplication = this.applicationFactory.createApplication(span.getApplicationId(), span.getApplicationServiceType());
// records the Span's response time statistics
recordSpanResponseTime(spanApplication, span, mapHistogramSummary, span.getCollectorAcceptTime());
if (!spanApplication.getServiceType().isRecordStatistics() || spanApplication.getServiceType().isRpcClient()) {
// span's serviceType is probably not set correctly
logger.warn("invalid span application:{}", spanApplication);
continue;
}
final short slotTime = getHistogramSlotTime(span, spanApplication.getServiceType());
// might need to reconsider using collector's accept time for link statistics.
// we need to convert to time window's timestamp. If not, it may lead to OOM due to mismatch in timeslots.
long timestamp = window.refineTimestamp(span.getCollectorAcceptTime());
if (parentApplication.getServiceType() == ServiceType.USER) {
// Outbound data
if (logger.isTraceEnabled()) {
logger.trace("span user:{} {} -> span:{} {}", parentApplication, span.getAgentId(), spanApplication, span.getAgentId());
}
final LinkDataMap sourceLinkData = linkDataDuplexMap.getSourceLinkDataMap();
sourceLinkData.addLinkData(parentApplication, span.getAgentId(), spanApplication, span.getAgentId(), timestamp, slotTime, 1);
if (logger.isTraceEnabled()) {
logger.trace("span target user:{} {} -> span:{} {}", parentApplication, span.getAgentId(), spanApplication, span.getAgentId());
}
// Inbound data
final LinkDataMap targetLinkDataMap = linkDataDuplexMap.getTargetLinkDataMap();
targetLinkDataMap.addLinkData(parentApplication, span.getAgentId(), spanApplication, span.getAgentId(), timestamp, slotTime, 1);
} else {
// Inbound data
if (logger.isTraceEnabled()) {
logger.trace("span target parent:{} {} -> span:{} {}", parentApplication, span.getAgentId(), spanApplication, span.getAgentId());
}
final LinkDataMap targetLinkDataMap = linkDataDuplexMap.getTargetLinkDataMap();
targetLinkDataMap.addLinkData(parentApplication, span.getAgentId(), spanApplication, span.getAgentId(), timestamp, slotTime, 1);
}
if (serverMapDataFilter != null && serverMapDataFilter.filter(spanApplication)) {
continue;
}
addNodeFromSpanEvent(span, window, linkDataDuplexMap, transactionSpanMap);
}
}
ApplicationMapBuilder applicationMapBuilder = new ApplicationMapBuilder(range);
mapHistogramSummary.build();
ApplicationMap map = applicationMapBuilder.build(linkDataDuplexMap, agentInfoService, mapHistogramSummary);
if (serverMapDataFilter != null) {
map = serverMapDataFilter.dataFiltering(map);
}
return map;
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class FilteredMapServiceImpl method createDotExtractor.
private DotExtractor createDotExtractor(Range scanRange, List<List<SpanBo>> filterList) {
final DotExtractor dotExtractor = new DotExtractor(scanRange, applicationFactory);
for (List<SpanBo> transaction : filterList) {
for (SpanBo span : transaction) {
final Application spanApplication = this.applicationFactory.createApplication(span.getApplicationId(), span.getApplicationServiceType());
if (!spanApplication.getServiceType().isRecordStatistics() || spanApplication.getServiceType().isRpcClient()) {
continue;
}
dotExtractor.addDot(span);
}
}
return dotExtractor;
}
Aggregations