use of com.navercorp.pinpoint.common.server.bo.SpanBo in project pinpoint by naver.
the class ScatterChartServiceImpl method selectScatterData.
@Override
public ScatterData selectScatterData(List<TransactionId> transactionIdList, String applicationName, Range range, int xGroupUnit, int yGroupUnit, Filter filter) {
if (transactionIdList == null) {
throw new NullPointerException("transactionIdList must not be null");
}
if (applicationName == null) {
throw new NullPointerException("applicationName must not be null");
}
if (filter == null) {
throw new NullPointerException("filter must not be null");
}
final List<List<SpanBo>> traceList = traceDao.selectAllSpans(transactionIdList);
ScatterData scatterData = new ScatterData(range.getFrom(), range.getTo(), xGroupUnit, yGroupUnit);
for (List<SpanBo> trace : traceList) {
if (!filter.include(trace)) {
continue;
}
for (SpanBo span : trace) {
if (applicationName.equals(span.getApplicationId())) {
final TransactionId transactionId = span.getTransactionId();
final Dot dot = new Dot(transactionId, span.getCollectorAcceptTime(), span.getElapsed(), span.getErrCode(), span.getAgentId());
scatterData.addDot(dot);
}
}
}
return scatterData;
}
use of com.navercorp.pinpoint.common.server.bo.SpanBo in project pinpoint by naver.
the class ScatterChartServiceImpl method selectScatterData.
@Override
public List<Dot> selectScatterData(List<TransactionId> transactionIdList, String applicationName, Filter filter) {
if (transactionIdList == null) {
throw new NullPointerException("transactionIdList must not be null");
}
if (applicationName == null) {
throw new NullPointerException("applicationName must not be null");
}
if (filter == null) {
throw new NullPointerException("filter must not be null");
}
final List<List<SpanBo>> traceList = traceDao.selectAllSpans(transactionIdList);
final List<Dot> result = new ArrayList<>();
for (List<SpanBo> trace : traceList) {
if (!filter.include(trace)) {
continue;
}
for (SpanBo span : trace) {
if (applicationName.equals(span.getApplicationId())) {
final TransactionId transactionId = span.getTransactionId();
final Dot dot = new Dot(transactionId, span.getCollectorAcceptTime(), span.getElapsed(), span.getErrCode(), span.getAgentId());
result.add(dot);
}
}
}
return result;
}
use of com.navercorp.pinpoint.common.server.bo.SpanBo in project pinpoint by naver.
the class AcceptUrlFilterTest method acceptTest_1.
@Test
public void acceptTest_1() {
AcceptUrlFilter filter = new AcceptUrlFilter(encode("/**/*"));
SpanBo spanBo = new SpanBo();
spanBo.setRpc("/test");
Assert.assertTrue(filter.accept(Arrays.asList(spanBo)));
}
use of com.navercorp.pinpoint.common.server.bo.SpanBo in project pinpoint by naver.
the class LinkFilterTest method fromToFilterAgentTest.
@Test
public void fromToFilterAgentTest() {
final ServiceType tomcat = serviceTypeRegistryService.findServiceTypeByName("TOMCAT");
final short tomcatServiceType = tomcat.getCode();
FilterDescriptor descriptor = new FilterDescriptor();
descriptor.setFromApplicationName("APP_A");
descriptor.setFromServiceType(tomcat.getName());
descriptor.setFromAgentId("AGENT_A");
descriptor.setToApplicationName("APP_B");
descriptor.setToServiceType(tomcat.getName());
descriptor.setToAgentId("AGENT_B");
FilterHint hint = new FilterHint(Collections.<RpcHint>emptyList());
LinkFilter linkFilter = new LinkFilter(descriptor, hint, serviceTypeRegistryService);
logger.debug(linkFilter.toString());
SpanBo fromSpanBo = new SpanBo();
fromSpanBo.setApplicationId("APP_A");
fromSpanBo.setServiceType(tomcatServiceType);
fromSpanBo.setAgentId("AGENT_A");
fromSpanBo.setSpanId(100);
SpanBo toSpanBO = new SpanBo();
toSpanBO.setApplicationId("APP_B");
toSpanBO.setServiceType(tomcatServiceType);
toSpanBO.setAgentId("AGENT_B");
toSpanBO.setParentSpanId(100);
SpanBo spanBoC = new SpanBo();
spanBoC.setApplicationId("APP_C");
spanBoC.setServiceType(tomcatServiceType);
spanBoC.setAgentId("AGENT_C");
Assert.assertTrue(linkFilter.include(Arrays.asList(fromSpanBo, toSpanBO)));
Assert.assertFalse(linkFilter.include(Arrays.asList(fromSpanBo, spanBoC)));
}
use of com.navercorp.pinpoint.common.server.bo.SpanBo in project pinpoint by naver.
the class LinkFilterTest method fromToFilterTest.
@Test
public void fromToFilterTest() {
ServiceType tomcat = serviceTypeRegistryService.findServiceTypeByName("TOMCAT");
final short tomcatServiceType = tomcat.getCode();
FilterDescriptor descriptor = new FilterDescriptor();
descriptor.setFromApplicationName("APP_A");
descriptor.setFromServiceType(tomcat.getName());
// descriptor.setFromAgentId("AGENT_A");
descriptor.setToApplicationName("APP_B");
descriptor.setToServiceType(tomcat.getName());
// descriptor.setToAgentId("AGENT_B");
FilterHint hint = new FilterHint(Collections.<RpcHint>emptyList());
LinkFilter linkFilter = new LinkFilter(descriptor, hint, serviceTypeRegistryService);
logger.debug(linkFilter.toString());
SpanBo fromSpanBo = new SpanBo();
fromSpanBo.setApplicationId("APP_A");
fromSpanBo.setServiceType(tomcatServiceType);
fromSpanBo.setAgentId("AGENT_A");
fromSpanBo.setSpanId(100);
SpanBo toSpanBO = new SpanBo();
toSpanBO.setApplicationId("APP_B");
toSpanBO.setServiceType(tomcatServiceType);
toSpanBO.setAgentId("AGENT_B");
toSpanBO.setParentSpanId(100);
SpanBo spanBoC = new SpanBo();
spanBoC.setApplicationId("APP_C");
spanBoC.setServiceType(tomcatServiceType);
spanBoC.setAgentId("AGENT_C");
Assert.assertTrue(linkFilter.include(Arrays.asList(fromSpanBo, toSpanBO)));
Assert.assertFalse(linkFilter.include(Arrays.asList(fromSpanBo, spanBoC)));
}
Aggregations