Search in sources :

Example 1 with ResponseTime

use of com.navercorp.pinpoint.web.vo.ResponseTime in project pinpoint by naver.

the class ApplicationMapBuilder method build.

public ApplicationMap build(LinkDataDuplexMap linkDataDuplexMap, final AgentInfoService agentInfoService, final ResponseHistogramBuilder mapHistogramSummary) {
    AgentInfoPopulator agentInfoPopulator = new AgentInfoPopulator() {

        @Override
        public void addAgentInfos(Node node) {
            ServerInstanceList serverInstanceList = getServerInstanceList(node, agentInfoService);
            node.setServerInstanceList(serverInstanceList);
        }
    };
    NodeHistogramDataSource responseSource = new NodeHistogramDataSource() {

        @Override
        public NodeHistogram createNodeHistogram(Application application) {
            List<ResponseTime> responseHistogram = mapHistogramSummary.getResponseTimeList(application);
            final NodeHistogram nodeHistogram = new NodeHistogram(application, range, responseHistogram);
            return nodeHistogram;
        }
    };
    return this.build(linkDataDuplexMap, agentInfoPopulator, responseSource);
}
Also used : ResponseTime(com.navercorp.pinpoint.web.vo.ResponseTime) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) Application(com.navercorp.pinpoint.web.vo.Application)

Example 2 with ResponseTime

use of com.navercorp.pinpoint.web.vo.ResponseTime in project pinpoint by naver.

the class ApplicationMapBuilder method build.

public ApplicationMap build(LinkDataDuplexMap linkDataDuplexMap, final AgentInfoService agentInfoService, final MapResponseDao mapResponseDao) {
    AgentInfoPopulator agentInfoPopulator = new AgentInfoPopulator() {

        @Override
        public void addAgentInfos(Node node) {
            ServerInstanceList serverInstanceList = getServerInstanceList(node, agentInfoService);
            node.setServerInstanceList(serverInstanceList);
        }
    };
    NodeHistogramDataSource responseSource = new NodeHistogramDataSource() {

        @Override
        public NodeHistogram createNodeHistogram(Application application) {
            final List<ResponseTime> responseHistogram = mapResponseDao.selectResponseTime(application, range);
            final NodeHistogram nodeHistogram = new NodeHistogram(application, range, responseHistogram);
            return nodeHistogram;
        }
    };
    return this.build(linkDataDuplexMap, agentInfoPopulator, responseSource);
}
Also used : ResponseTime(com.navercorp.pinpoint.web.vo.ResponseTime) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) Application(com.navercorp.pinpoint.web.vo.Application)

Example 3 with ResponseTime

use of com.navercorp.pinpoint.web.vo.ResponseTime in project pinpoint by naver.

the class ApplicationTimeHistogramBuilder method build.

public ApplicationTimeHistogram build(List<ResponseTime> responseHistogramList) {
    Objects.requireNonNull(responseHistogramList, "responseHistogramList");
    Map<Long, TimeHistogram> applicationLevelHistogram = new HashMap<>();
    for (ResponseTime responseTime : responseHistogramList) {
        final Long timeStamp = responseTime.getTimeStamp();
        TimeHistogram timeHistogram = applicationLevelHistogram.get(timeStamp);
        if (timeHistogram == null) {
            timeHistogram = new TimeHistogram(application.getServiceType(), timeStamp);
            applicationLevelHistogram.put(timeStamp, timeHistogram);
        }
        // add each agent-level data
        Histogram applicationResponseHistogram = responseTime.getApplicationResponseHistogram();
        timeHistogram.add(applicationResponseHistogram);
    }
    // Collections.sort(histogramList, TimeHistogram.TIME_STAMP_ASC_COMPARATOR);
    List<TimeHistogram> histogramList = interpolation(applicationLevelHistogram.values());
    if (logger.isTraceEnabled()) {
        for (TimeHistogram histogram : histogramList) {
            logger.trace("applicationLevel histogram:{}", histogram);
        }
    }
    ApplicationTimeHistogram applicationTimeHistogram = new ApplicationTimeHistogram(application, range, histogramList);
    return applicationTimeHistogram;
}
Also used : ResponseTime(com.navercorp.pinpoint.web.vo.ResponseTime)

Example 4 with ResponseTime

use of com.navercorp.pinpoint.web.vo.ResponseTime in project pinpoint by naver.

the class HbaseMapResponseTimeDao method selectResponseTime.

@Override
public List<ResponseTime> selectResponseTime(Application application, Range range) {
    Objects.requireNonNull(application, "application");
    if (logger.isDebugEnabled()) {
        logger.debug("selectResponseTime applicationName:{}, {}", application, range);
    }
    Scan scan = createScan(application, range, DESCRIPTOR.getName());
    TableName mapStatisticsSelfTableName = tableNameProvider.getTableName(DESCRIPTOR.getTable());
    List<ResponseTime> responseTimeList = hbaseOperations2.findParallel(mapStatisticsSelfTableName, scan, rowKeyDistributorByHashPrefix, responseTimeMapper, MAP_STATISTICS_SELF_VER2_NUM_PARTITIONS);
    if (!responseTimeList.isEmpty()) {
        return responseTimeList;
    }
    return new ArrayList<>();
}
Also used : TableName(org.apache.hadoop.hbase.TableName) ArrayList(java.util.ArrayList) Scan(org.apache.hadoop.hbase.client.Scan) ResponseTime(com.navercorp.pinpoint.web.vo.ResponseTime)

Example 5 with ResponseTime

use of com.navercorp.pinpoint.web.vo.ResponseTime in project pinpoint by naver.

the class ResponseTimeMapper method createResponseTime.

private ResponseTime createResponseTime(byte[] rowKey) {
    final Buffer row = new FixedBuffer(rowKey);
    String applicationName = row.read2PrefixedString();
    short serviceTypeCode = row.readShort();
    final long timestamp = TimeUtils.recoveryTimeMillis(row.readLong());
    ServiceType serviceType = registry.findServiceType(serviceTypeCode);
    return new ResponseTime(applicationName, serviceType, timestamp);
}
Also used : FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer) Buffer(com.navercorp.pinpoint.common.buffer.Buffer) FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer) ServiceType(com.navercorp.pinpoint.common.trace.ServiceType) ResponseTime(com.navercorp.pinpoint.web.vo.ResponseTime)

Aggregations

ResponseTime (com.navercorp.pinpoint.web.vo.ResponseTime)18 Application (com.navercorp.pinpoint.web.vo.Application)7 Range (com.navercorp.pinpoint.web.vo.Range)5 ArrayList (java.util.ArrayList)5 Test (org.junit.Test)5 NodeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)2 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)2 TimeViewModel (com.navercorp.pinpoint.web.view.TimeViewModel)2 ResponseHistograms (com.navercorp.pinpoint.web.vo.ResponseHistograms)2 Cell (org.apache.hadoop.hbase.Cell)2 JsonFactory (com.fasterxml.jackson.core.JsonFactory)1 JsonGenerator (com.fasterxml.jackson.core.JsonGenerator)1 ObjectWriter (com.fasterxml.jackson.databind.ObjectWriter)1 AutomaticBuffer (com.navercorp.pinpoint.common.buffer.AutomaticBuffer)1 FixedBuffer (com.navercorp.pinpoint.common.buffer.FixedBuffer)1 SimpleAgentKey (com.navercorp.pinpoint.common.server.bo.SimpleAgentKey)1 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)1 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)1 HistogramSlot (com.navercorp.pinpoint.common.trace.HistogramSlot)1