Search in sources :

Example 6 with ServiceType

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

the class PluginTestAgent method resolveExpectedTrace.

private ResolvedExpectedTrace resolveExpectedTrace(ExpectedTrace expected, Integer asyncId) throws AssertionError {
    final ServiceType serviceType = findServiceType(expected.getServiceType());
    final Class<?> spanClass = resolveSpanClass(expected.getType());
    final int apiId = getApiId(expected);
    return new ResolvedExpectedTrace(spanClass, serviceType, apiId, expected.getRpc(), expected.getEndPoint(), expected.getRemoteAddr(), expected.getDestinationId(), expected.getAnnotations(), asyncId);
}
Also used : ServiceType(com.navercorp.pinpoint.common.trace.ServiceType)

Example 7 with ServiceType

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

the class PluginTestAgent method verifyServerType.

@Override
public void verifyServerType(String serviceTypeName) {
    final ApplicationContext applicationContext = getApplicationContext();
    ServiceType expectedType = findServiceType(serviceTypeName);
    ServiceType actualType = applicationContext.getAgentInformation().getServerType();
    if (!expectedType.equals(actualType)) {
        throw new AssertionError("ResolvedExpectedTrace server type: " + expectedType.getName() + "[" + expectedType.getCode() + "] but was " + actualType + "[" + actualType.getCode() + "]");
    }
}
Also used : DefaultApplicationContext(com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext) ApplicationContext(com.navercorp.pinpoint.profiler.context.module.ApplicationContext) ServiceType(com.navercorp.pinpoint.common.trace.ServiceType)

Example 8 with ServiceType

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

the class ApplicationMapBuilder method appendNodeResponseTime.

public void appendNodeResponseTime(NodeList nodeList, LinkList linkList, NodeHistogramDataSource nodeHistogramDataSource) {
    if (nodeHistogramDataSource == null) {
        throw new NullPointerException("nodeHistogramDataSource must not be null");
    }
    final Collection<Node> nodes = nodeList.getNodeList();
    for (Node node : nodes) {
        final ServiceType nodeType = node.getServiceType();
        if (nodeType.isWas()) {
            // for WAS nodes, set their own response time histogram
            final Application wasNode = node.getApplication();
            final NodeHistogram nodeHistogram = nodeHistogramDataSource.createNodeHistogram(wasNode);
            node.setNodeHistogram(nodeHistogram);
        } else if (nodeType.isTerminal() || nodeType.isUnknown()) {
            final NodeHistogram nodeHistogram = createTerminalNodeHistogram(node, linkList);
            node.setNodeHistogram(nodeHistogram);
        } else if (nodeType.isQueue()) {
            // Virtual queue node - queues with agent installed will be handled above as a WAS node
            final NodeHistogram nodeHistogram = createTerminalNodeHistogram(node, linkList);
            node.setNodeHistogram(nodeHistogram);
        } else if (nodeType.isUser()) {
            // for User nodes, find its source link and create the histogram
            Application userNode = node.getApplication();
            final NodeHistogram nodeHistogram = new NodeHistogram(userNode, range);
            final List<Link> fromLink = linkList.findFromLink(userNode);
            if (fromLink.size() > 1) {
                // used first(0) link.
                logger.warn("Invalid from UserNode:{}", linkList.getLinkList());
            } else if (fromLink.isEmpty()) {
                logger.warn("from UserNode not found:{}", userNode);
                continue;
            }
            final Link sourceLink = fromLink.get(0);
            nodeHistogram.setApplicationHistogram(sourceLink.getHistogram());
            ApplicationTimeHistogram histogramData = sourceLink.getTargetApplicationTimeSeriesHistogramData();
            nodeHistogram.setApplicationTimeHistogram(histogramData);
            node.setNodeHistogram(nodeHistogram);
        } else {
            // dummy data
            NodeHistogram dummy = new NodeHistogram(node.getApplication(), range);
            node.setNodeHistogram(dummy);
        }
    }
}
Also used : ApplicationTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram) ServiceType(com.navercorp.pinpoint.common.trace.ServiceType) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) List(java.util.List) AgentHistogramList(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList) Application(com.navercorp.pinpoint.web.vo.Application)

Example 9 with ServiceType

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

the class ApplicationTimeHistogram method createViewModel.

public List<ResponseTimeViewModel> createViewModel() {
    final List<ResponseTimeViewModel> value = new ArrayList<>(5);
    ServiceType serviceType = application.getServiceType();
    HistogramSchema schema = serviceType.getHistogramSchema();
    value.add(new ResponseTimeViewModel(schema.getFastSlot().getSlotName(), getColumnValue(SlotType.FAST)));
    //        value.add(new ResponseTimeViewModel(schema.getFastErrorSlot().getSlotName(), getColumnValue(SlotType.FAST_ERROR)));
    value.add(new ResponseTimeViewModel(schema.getNormalSlot().getSlotName(), getColumnValue(SlotType.NORMAL)));
    //        value.add(new ResponseTimeViewModel(schema.getNormalErrorSlot().getSlotName(), getColumnValue(SlotType.NORMAL_ERROR)));
    value.add(new ResponseTimeViewModel(schema.getSlowSlot().getSlotName(), getColumnValue(SlotType.SLOW)));
    //        value.add(new ResponseTimeViewModel(schema.getSlowErrorSlot().getSlotName(), getColumnValue(SlotType.SLOW_ERROR)));
    value.add(new ResponseTimeViewModel(schema.getVerySlowSlot().getSlotName(), getColumnValue(SlotType.VERY_SLOW)));
    //        value.add(new ResponseTimeViewModel(schema.getVerySlowErrorSlot().getSlotName(), getColumnValue(SlotType.VERY_SLOW_ERROR)));
    value.add(new ResponseTimeViewModel(schema.getErrorSlot().getSlotName(), getColumnValue(SlotType.ERROR)));
    return value;
}
Also used : HistogramSchema(com.navercorp.pinpoint.common.trace.HistogramSchema) ServiceType(com.navercorp.pinpoint.common.trace.ServiceType) ResponseTimeViewModel(com.navercorp.pinpoint.web.view.ResponseTimeViewModel)

Example 10 with ServiceType

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

the class AgentHistogramList method addAgentHistogram.

public void addAgentHistogram(AgentHistogram agentHistogram) {
    if (agentHistogram == null) {
        throw new NullPointerException("agentHistogram must not be null");
    }
    final String hostName = agentHistogram.getId();
    ServiceType serviceType = agentHistogram.getServiceType();
    Application agentId = new Application(hostName, serviceType);
    AgentHistogram findAgentHistogram = getAgentHistogram(agentId);
    findAgentHistogram.addTimeHistogram(agentHistogram.getTimeHistogram());
}
Also used : ServiceType(com.navercorp.pinpoint.common.trace.ServiceType) Application(com.navercorp.pinpoint.web.vo.Application)

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