use of com.navercorp.pinpoint.web.vo.scatter.Dot 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.web.vo.scatter.Dot 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.web.vo.scatter.Dot in project pinpoint by naver.
the class ScatterDataSerializer method writeDotSet.
private void writeDotSet(DotGroups dotGroups, ScatterAgentMetaData metaData, JsonGenerator jgen) throws IOException {
Map<Dot, DotGroup> dotGroupLeaders = dotGroups.getDotGroupLeaders();
Set<Dot> dotSet = dotGroups.getSortedDotSet();
for (Dot dot : dotSet) {
if (dotGroupLeaders.containsKey(dot)) {
writeDot(dot, dotGroupLeaders.get(dot).getDotSize(), metaData, jgen);
} else {
writeDot(dot, 0, metaData, jgen);
}
}
}
use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.
the class ScatterDataTest method mergeTest.
@Test
public void mergeTest() throws Exception {
int count = 100;
long from = 1000;
long to = 10000;
int xGroupUnit = 100;
int yGroupUnit = 100;
ScatterData scatterData = new ScatterData(from, to, xGroupUnit, yGroupUnit);
List<Dot> dotList = createDotList(agentId, transactionAgentId, count, from);
for (Dot dot : dotList) {
ScatterData newScatterData = new ScatterData(from, to, xGroupUnit, yGroupUnit);
newScatterData.addDot(dot);
scatterData.merge(newScatterData);
}
List<Dot> dots = extractDotList(scatterData);
Assert.assertEquals(count, dots.size());
}
use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.
the class DotSerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
TransactionId transactionId = TransactionIdUtils.parseTransactionId("aigw.dev.1^1395798795017^1527177");
Dot dot = new Dot(transactionId, 100, 99, 1, "agent");
String jsonValue = mapper.writeValueAsString(dot);
Assert.assertEquals("[100,99,\"aigw.dev.1^1395798795017^1527177\",0]", jsonValue);
}
Aggregations