private NodeHistogramSummary getTerminalNodeHistogramSummary(ResponseTimeHistogramServiceOption option) {
        Application application = option.getApplication();
        Range range = option.getRange();
        TimeWindow timeWindow = option.getTimeWindow();

        ServiceType applicationServiceType = application.getServiceType();

        final ServerGroupListFactory serverGroupListFactory = createServerGroupListFactory(option.isUseStatisticsAgentState());
        List<Application> sourceApplications = option.getFromApplications();
        if (sourceApplications.isEmpty()) {
            return createEmptyNodeHistogramSummary(serverGroupListFactory, application, range);
        }
        LinkDataMapProcessor destinationApplicationFilter = new DestinationApplicationFilter(application);
        LinkSelector linkSelector = linkSelectorFactory.createLinkSelector(LinkSelectorType.UNIDIRECTIONAL, destinationApplicationFilter, LinkDataMapProcessor.NO_OP);
        LinkDataDuplexMap linkDataDuplexMap = linkSelector.select(sourceApplications, timeWindow, 1, 0);

        ServerGroupList serverGroupList = serverGroupListFactory.createEmptyNodeInstanceList();
        if (applicationServiceType.isTerminal() || applicationServiceType.isAlias()) {
            Node node = new Node(application);
            serverGroupList = serverGroupListFactory.createTerminalNodeInstanceList(node, linkDataDuplexMap);
        }

        NodeList nodeList = NodeListFactory.createNodeList(linkDataDuplexMap);
        LinkList linkList = LinkListFactory.createLinkList(nodeList, linkDataDuplexMap, range);

        final NodeHistogramFactory nodeHistogramFactory = createNodeHistogramFactory();
        NodeHistogram nodeHistogram = nodeHistogramFactory.createTerminalNodeHistogram(application, range, linkList);
        return new NodeHistogramSummary(application, serverGroupList, nodeHistogram);
    }
@author HyunGil Jeong
@author jaehong.kim
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/service/ResponseTimeHistogramServiceImpl.java