Search in sources :

Example 26 with Application

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();
}
Also used : ApplicationMapWithScatterData(com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData) ApplicationMapWithScatterScanResult(com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterScanResult) ApplicationScatterScanResult(com.navercorp.pinpoint.web.vo.scatter.ApplicationScatterScanResult) Application(com.navercorp.pinpoint.web.vo.Application) Map(java.util.Map) ScatterData(com.navercorp.pinpoint.web.scatter.ScatterData) ApplicationMapWithScatterData(com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData)

Example 27 with Application

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();
}
Also used : Application(com.navercorp.pinpoint.web.vo.Application)

Example 28 with Application

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);
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) OffsetFixedBuffer(com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer) OffsetFixedBuffer(com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer) AcceptApplication(com.navercorp.pinpoint.web.service.map.AcceptApplication) Application(com.navercorp.pinpoint.web.vo.Application) AcceptApplication(com.navercorp.pinpoint.web.service.map.AcceptApplication)

Example 29 with Application

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));
}
Also used : LinkVisitChecker(com.navercorp.pinpoint.web.service.LinkVisitChecker) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Example 30 with Application

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());
}
Also used : Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Aggregations

Application (com.navercorp.pinpoint.web.vo.Application)90 Test (org.junit.Test)39 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)30 MapStatisticsCallerDataCollector (com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector)15 ResponseTimeDataCollector (com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector)11 AcceptApplication (com.navercorp.pinpoint.web.service.map.AcceptApplication)11 RpcApplication (com.navercorp.pinpoint.web.service.map.RpcApplication)10 Range (com.navercorp.pinpoint.web.vo.Range)10 AgentHistogram (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram)5 List (java.util.List)5 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)5 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)5 AgentStatDataCollector (com.navercorp.pinpoint.web.alarm.collector.AgentStatDataCollector)4 AgentHistogramList (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList)4 LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)4 ArrayList (java.util.ArrayList)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)3 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)3 ErrorCountToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorCountToCalleeChecker)3 ErrorRateToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorRateToCalleeChecker)3