Search in sources :

Example 1 with ServiceType

use of com.navercorp.pinpoint.common.trace.ServiceType in project pinpoint by naver.

the class ApplicationServerTypeProvider method get.

@Override
public ServiceType get() {
    final ServiceType applicationServiceType = getApplicationServiceType();
    logger.info("default ApplicationServerType={}", applicationServiceType);
    PluginContextLoadResult pluginContextLoadResult = this.pluginContextLoadResultProvider.get();
    List<ApplicationTypeDetector> applicationTypeDetectorList = pluginContextLoadResult.getApplicationTypeDetectorList();
    ApplicationServerTypeResolver applicationServerTypeResolver = new ApplicationServerTypeResolver(applicationTypeDetectorList, applicationServiceType, profilerConfig.getApplicationTypeDetectOrder());
    ServiceType resolve = applicationServerTypeResolver.resolve();
    logger.info("resolved ApplicationServerType={}", resolve);
    return resolve;
}
Also used : ApplicationServerTypeResolver(com.navercorp.pinpoint.profiler.util.ApplicationServerTypeResolver) ServiceType(com.navercorp.pinpoint.common.trace.ServiceType) ApplicationTypeDetector(com.navercorp.pinpoint.bootstrap.plugin.ApplicationTypeDetector) PluginContextLoadResult(com.navercorp.pinpoint.profiler.plugin.PluginContextLoadResult)

Example 2 with ServiceType

use of com.navercorp.pinpoint.common.trace.ServiceType in project pinpoint by naver.

the class SpanHandler method insertSpanEventStat.

private void insertSpanEventStat(SpanBo span) {
    final List<SpanEventBo> spanEventList = span.getSpanEventBoList();
    if (CollectionUtils.isEmpty(spanEventList)) {
        return;
    }
    final ServiceType applicationServiceType = getApplicationServiceType(span);
    logger.debug("handle spanEvent size:{}", spanEventList.size());
    // TODO need to batch update later.
    for (SpanEventBo spanEvent : spanEventList) {
        final ServiceType spanEventType = registry.findServiceType(spanEvent.getServiceType());
        if (!spanEventType.isRecordStatistics()) {
            continue;
        }
        // if terminal update statistics
        final int elapsed = spanEvent.getEndElapsed();
        final boolean hasException = spanEvent.hasException();
        /*
             * save information to draw a server map based on statistics
             */
        // save the information of caller (the spanevent that called span)
        statisticsHandler.updateCaller(span.getApplicationId(), applicationServiceType, span.getAgentId(), spanEvent.getDestinationId(), spanEventType, spanEvent.getEndPoint(), elapsed, hasException);
        // save the information of callee (the span that spanevent called)
        statisticsHandler.updateCallee(spanEvent.getDestinationId(), spanEventType, span.getApplicationId(), applicationServiceType, span.getEndPoint(), elapsed, hasException);
    }
}
Also used : ServiceType(com.navercorp.pinpoint.common.trace.ServiceType) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo)

Example 3 with ServiceType

use of com.navercorp.pinpoint.common.trace.ServiceType in project pinpoint by naver.

the class SpanHandler method insertAcceptorHost.

private void insertAcceptorHost(SpanBo span) {
    // save host application map
    // acceptor host is set at profiler module only when the span is not the kind of root span
    final String acceptorHost = span.getAcceptorHost();
    if (acceptorHost == null) {
        return;
    }
    final String spanApplicationName = span.getApplicationId();
    final short applicationServiceTypeCode = getApplicationServiceType(span).getCode();
    final String parentApplicationName = span.getParentApplicationId();
    final short parentServiceType = span.getParentApplicationServiceType();
    final ServiceType spanServiceType = registry.findServiceType(span.getServiceType());
    if (spanServiceType.isQueue()) {
        hostApplicationMapDao.insert(span.getEndPoint(), spanApplicationName, applicationServiceTypeCode, parentApplicationName, parentServiceType);
    } else {
        hostApplicationMapDao.insert(acceptorHost, spanApplicationName, applicationServiceTypeCode, parentApplicationName, parentServiceType);
    }
}
Also used : ServiceType(com.navercorp.pinpoint.common.trace.ServiceType)

Example 4 with ServiceType

use of com.navercorp.pinpoint.common.trace.ServiceType in project pinpoint by naver.

the class FilteredMapServiceImpl method addNodeFromSpanEvent.

private void addNodeFromSpanEvent(SpanBo span, TimeWindow window, LinkDataDuplexMap linkDataDuplexMap, Map<Long, SpanBo> transactionSpanMap) {
    /*
         * add span event statistics
         */
    final List<SpanEventBo> spanEventBoList = span.getSpanEventBoList();
    if (CollectionUtils.isEmpty(spanEventBoList)) {
        return;
    }
    final Application srcApplication = applicationFactory.createApplication(span.getApplicationId(), span.getApplicationServiceType());
    LinkDataMap sourceLinkDataMap = linkDataDuplexMap.getSourceLinkDataMap();
    for (SpanEventBo spanEvent : spanEventBoList) {
        ServiceType destServiceType = registry.findServiceType(spanEvent.getServiceType());
        if (!destServiceType.isRecordStatistics()) {
            // internal method
            continue;
        }
        // logic for checking acceptor
        if (destServiceType.isRpcClient()) {
            if (!transactionSpanMap.containsKey(spanEvent.getNextSpanId())) {
                destServiceType = ServiceType.UNKNOWN;
            }
        }
        String dest = spanEvent.getDestinationId();
        if (dest == null) {
            dest = "Unknown";
        }
        final Application destApplication = this.applicationFactory.createApplication(dest, destServiceType);
        final short slotTime = getHistogramSlotTime(spanEvent, destServiceType);
        // FIXME
        final long spanEventTimeStamp = window.refineTimestamp(span.getStartTime() + spanEvent.getStartElapsed());
        if (logger.isTraceEnabled()) {
            logger.trace("spanEvent  src:{} {} -> dest:{} {}", srcApplication, span.getAgentId(), destApplication, spanEvent.getEndPoint());
        }
        // endPoint may be null
        final String destinationAgentId = StringUtils.defaultString(spanEvent.getEndPoint());
        sourceLinkDataMap.addLinkData(srcApplication, span.getAgentId(), destApplication, destinationAgentId, spanEventTimeStamp, slotTime, 1);
    }
}
Also used : ServiceType(com.navercorp.pinpoint.common.trace.ServiceType) Application(com.navercorp.pinpoint.web.vo.Application) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)

Example 5 with ServiceType

use of com.navercorp.pinpoint.common.trace.ServiceType in project pinpoint by naver.

the class ServerInstanceSerializer method serialize.

@Override
public void serialize(ServerInstance serverInstance, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
    jgen.writeStartObject();
    final short serviceTypeCode = serverInstance.getServiceTypeCode();
    final ServiceType serviceType = serviceTypeRegistryService.findServiceType(serviceTypeCode);
    jgen.writeBooleanField("hasInspector", hasInspector(serviceType));
    jgen.writeStringField("name", serverInstance.getName());
    jgen.writeStringField("serviceType", serviceType.getName());
    jgen.writeFieldName("status");
    write(serverInstance.getStatus(), jgen, provider);
    jgen.writeEndObject();
}
Also used : ServiceType(com.navercorp.pinpoint.common.trace.ServiceType)

Aggregations

ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)34 Test (org.junit.Test)5 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)4 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)4 Application (com.navercorp.pinpoint.web.vo.Application)3 HistogramSchema (com.navercorp.pinpoint.common.trace.HistogramSchema)2 NodeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram)2 ResponseTimeViewModel (com.navercorp.pinpoint.web.view.ResponseTimeViewModel)2 ApplicationTypeDetector (com.navercorp.pinpoint.bootstrap.plugin.ApplicationTypeDetector)1 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)1 FixedBuffer (com.navercorp.pinpoint.common.buffer.FixedBuffer)1 AgentInfoBo (com.navercorp.pinpoint.common.server.bo.AgentInfoBo)1 AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)1 SpanChunkBo (com.navercorp.pinpoint.common.server.bo.SpanChunkBo)1 DefaultServiceTypeRegistryService (com.navercorp.pinpoint.common.service.DefaultServiceTypeRegistryService)1 ServiceTypeRegistryService (com.navercorp.pinpoint.common.service.ServiceTypeRegistryService)1 ServiceTypeInfo (com.navercorp.pinpoint.common.trace.ServiceTypeInfo)1 ServiceTypeRegistry (com.navercorp.pinpoint.common.trace.ServiceTypeRegistry)1 TraceMetadataLoader (com.navercorp.pinpoint.common.trace.TraceMetadataLoader)1 TraceMetadataProvider (com.navercorp.pinpoint.common.trace.TraceMetadataProvider)1