use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class FilterMapWrapSerializer method serialize.
@Override
public void serialize(FilterMapWrap wrap, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
jgen.writeStartObject();
jgen.writeObjectField("applicationMapData", wrap.getApplicationMap());
jgen.writeNumberField("lastFetchedTimestamp", wrap.getLastFetchedTimestamp());
if (wrap.getApplicationMap() instanceof ApplicationMapWithScatterScanResult) {
final List<ApplicationScatterScanResult> applicationScatterScanResult = ((ApplicationMapWithScatterScanResult) wrap.getApplicationMap()).getApplicationScatterScanResultList();
jgen.writeFieldName("applicationScatterScanResult");
jgen.writeStartObject();
for (ApplicationScatterScanResult scatterScanResult : applicationScatterScanResult) {
Application application = scatterScanResult.getApplication();
String name = application.getName() + Node.NODE_DELIMITER + application.getServiceType().toString();
jgen.writeObjectField(name, scatterScanResult.getScatterScanResult());
}
jgen.writeEndObject();
}
if (wrap.getApplicationMap() instanceof ApplicationMapWithScatterData) {
Map<Application, ScatterData> applicationScatterDataMap = ((ApplicationMapWithScatterData) wrap.getApplicationMap()).getApplicationScatterDataMap();
jgen.writeFieldName("applicationScatterData");
jgen.writeStartObject();
for (Map.Entry<Application, ScatterData> entry : applicationScatterDataMap.entrySet()) {
Application application = entry.getKey();
String name = application.getName() + Node.NODE_DELIMITER + application.getServiceType().toString();
jgen.writeFieldName(name);
ScatterData scatterData = entry.getValue();
jgen.writeStartObject();
jgen.writeObjectField("from", scatterData.getFrom());
jgen.writeObjectField("to", scatterData.getTo());
jgen.writeObjectField("resultFrom", scatterData.getOldestAcceptedTime());
jgen.writeObjectField("resultTo", scatterData.getLatestAcceptedTime());
jgen.writeObjectField("scatter", scatterData);
jgen.writeEndObject();
}
jgen.writeEndObject();
}
jgen.writeEndObject();
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class LinkSerializer method writeSimpleNode.
private void writeSimpleNode(String fieldName, Node node, JsonGenerator jgen) throws IOException {
jgen.writeFieldName(fieldName);
jgen.writeStartObject();
Application application = node.getApplication();
jgen.writeStringField("applicationName", application.getName());
jgen.writeStringField("serviceType", application.getServiceType().toString());
jgen.writeNumberField("serviceTypeCode", application.getServiceTypeCode());
jgen.writeBooleanField("isWas", application.getServiceType().isWas());
jgen.writeEndObject();
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class HostApplicationMapperVer2 method createAcceptedApplication.
// private void readRowKey(byte[] rowKey) {
// final Buffer rowKeyBuffer= new FixedBuffer(rowKey);
// final String parentApplicationName = rowKeyBuffer.readPadStringAndRightTrim(HBaseTables.APPLICATION_NAME_MAX_LEN);
// final short parentApplicationServiceType = rowKeyBuffer.readShort();
// final long timeSlot = TimeUtils.recoveryTimeMillis(rowKeyBuffer.readLong());
//
// if (logger.isDebugEnabled()) {
// logger.debug("parentApplicationName:{}/{} time:{}", parentApplicationName, parentApplicationServiceType, timeSlot);
// }
// }
private AcceptApplication createAcceptedApplication(Cell cell) {
Buffer reader = new OffsetFixedBuffer(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());
String host = reader.readPrefixedString();
String bindApplicationName = reader.readPrefixedString();
short bindServiceTypeCode = reader.readShort();
final Application bindApplication = applicationFactory.createApplication(bindApplicationName, bindServiceTypeCode);
return new AcceptApplication(host, bindApplication);
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class LinkVisitCheckerTest method testVisitCallee.
@Test
public void testVisitCallee() throws Exception {
LinkVisitChecker checker = new LinkVisitChecker();
Application testApplication = new Application("test", ServiceType.STAND_ALONE);
Assert.assertFalse(checker.visitCallee(testApplication));
Assert.assertTrue(checker.visitCallee(testApplication));
Application newApp = new Application("newApp", ServiceType.STAND_ALONE);
Assert.assertFalse(checker.visitCallee(newApp));
Assert.assertTrue(checker.visitCallee(newApp));
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class AcceptApplicationLocalCacheTest method testFind.
@Test
public void testFind() throws Exception {
AcceptApplicationLocalCache cache = new AcceptApplicationLocalCache();
Application tomcat = new Application("Tomcat", ServiceType.STAND_ALONE);
RpcApplication rpc = new RpcApplication("localhost:8080", tomcat);
// find the application that accept the rpc request of calling to localhost:8080 at tomcat itself
Set<AcceptApplication> findSet = createAcceptApplication();
cache.put(rpc, findSet);
// found
Set<AcceptApplication> acceptApplications = cache.get(rpc);
Assert.assertEquals(acceptApplications.size(), 1);
Assert.assertEquals(acceptApplications.iterator().next(), localhost);
// not found
Set<AcceptApplication> unknown = cache.get(new RpcApplication("unknown:8080", tomcat));
Assert.assertTrue(unknown.isEmpty());
Assert.assertFalse(unknown.iterator().hasNext());
}
Aggregations