Search in sources :

Example 1 with MetricInfoAppender

use of com.navercorp.pinpoint.web.applicationmap.appender.metric.MetricInfoAppender in project pinpoint by naver.

the class ApplicationMapBuilder method build.

public ApplicationMap build(LinkDataDuplexMap linkDataDuplexMap, long timeoutMillis) {
    Objects.requireNonNull(linkDataDuplexMap, "linkDataDuplexMap");
    logger.info("Building application map");
    NodeType nodeType = this.nodeType;
    if (nodeType == null) {
        nodeType = NodeType.DETAILED;
    }
    LinkType linkType = this.linkType;
    if (linkType == null) {
        linkType = LinkType.DETAILED;
    }
    NodeList nodeList = NodeListFactory.createNodeList(nodeType, linkDataDuplexMap);
    LinkList linkList = LinkListFactory.createLinkList(linkType, nodeList, linkDataDuplexMap, range);
    NodeHistogramFactory nodeHistogramFactory = this.nodeHistogramFactory;
    if (nodeHistogramFactory == null) {
        nodeHistogramFactory = new EmptyNodeHistogramFactory();
    }
    NodeHistogramAppender nodeHistogramAppender = nodeHistogramAppenderFactory.create(nodeHistogramFactory);
    final TimeoutWatcher timeoutWatcher = new TimeoutWatcher(timeoutMillis);
    nodeHistogramAppender.appendNodeHistogram(range, nodeList, linkList, timeoutWatcher.remainingTimeMillis());
    ServerInstanceListFactory serverInstanceListFactory = this.serverInstanceListFactory;
    if (serverInstanceListFactory == null) {
        serverInstanceListFactory = new EmptyServerInstanceListFactory();
    }
    ServerInfoAppender serverInfoAppender = serverInfoAppenderFactory.create(serverInstanceListFactory);
    serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutWatcher.remainingTimeMillis());
    MetricInfoAppender metricInfoAppender = metricInfoAppenderFactory.create();
    metricInfoAppender.appendMetricInfo(range, nodeList, linkDataDuplexMap);
    return new DefaultApplicationMap(range, nodeList, linkList);
}
Also used : ServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.ServerInstanceListFactory) EmptyServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.EmptyServerInstanceListFactory) NodeHistogramAppender(com.navercorp.pinpoint.web.applicationmap.appender.histogram.NodeHistogramAppender) NodeList(com.navercorp.pinpoint.web.applicationmap.nodes.NodeList) EmptyServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.EmptyServerInstanceListFactory) EmptyNodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.EmptyNodeHistogramFactory) NodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.NodeHistogramFactory) NodeType(com.navercorp.pinpoint.web.applicationmap.nodes.NodeType) EmptyNodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.EmptyNodeHistogramFactory) LinkType(com.navercorp.pinpoint.web.applicationmap.link.LinkType) LinkList(com.navercorp.pinpoint.web.applicationmap.link.LinkList) ServerInfoAppender(com.navercorp.pinpoint.web.applicationmap.appender.server.ServerInfoAppender) MetricInfoAppender(com.navercorp.pinpoint.web.applicationmap.appender.metric.MetricInfoAppender)

Aggregations

EmptyNodeHistogramFactory (com.navercorp.pinpoint.web.applicationmap.appender.histogram.EmptyNodeHistogramFactory)1 NodeHistogramAppender (com.navercorp.pinpoint.web.applicationmap.appender.histogram.NodeHistogramAppender)1 NodeHistogramFactory (com.navercorp.pinpoint.web.applicationmap.appender.histogram.NodeHistogramFactory)1 MetricInfoAppender (com.navercorp.pinpoint.web.applicationmap.appender.metric.MetricInfoAppender)1 EmptyServerInstanceListFactory (com.navercorp.pinpoint.web.applicationmap.appender.server.EmptyServerInstanceListFactory)1 ServerInfoAppender (com.navercorp.pinpoint.web.applicationmap.appender.server.ServerInfoAppender)1 ServerInstanceListFactory (com.navercorp.pinpoint.web.applicationmap.appender.server.ServerInstanceListFactory)1 LinkList (com.navercorp.pinpoint.web.applicationmap.link.LinkList)1 LinkType (com.navercorp.pinpoint.web.applicationmap.link.LinkType)1 NodeList (com.navercorp.pinpoint.web.applicationmap.nodes.NodeList)1 NodeType (com.navercorp.pinpoint.web.applicationmap.nodes.NodeType)1