Search in sources :

Example 1 with LinkCallData

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData in project pinpoint by naver.

the class MapStatisticsCallerDataCollector method getCount.

public long getCount(String calleName, DataCategory dataCategory) {
    LinkCallData linkCallData = calleStatMap.get(calleName);
    long count = 0;
    if (linkCallData != null) {
        switch(dataCategory) {
            case SLOW_COUNT:
                for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
                    count += timeHistogram.getSlowCount();
                    count += timeHistogram.getVerySlowCount();
                }
                break;
            case ERROR_COUNT:
                for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
                    count += timeHistogram.getTotalErrorCount();
                }
                break;
            case TOTAL_COUNT:
                for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
                    count += timeHistogram.getTotalCount();
                }
                break;
            default:
                throw new IllegalArgumentException("Can't count for " + dataCategory.toString());
        }
        return count;
    }
    return 0;
}
Also used : TimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram) LinkCallData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)

Example 2 with LinkCallData

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData in project pinpoint by naver.

the class MapStatisticsCallerDataCollector method collect.

@Override
public void collect() {
    if (init.get()) {
        return;
    }
    LinkDataMap callerDataMap = mapStatisticsCallerDao.selectCaller(application, new Range(timeSlotEndTime - slotInterval, timeSlotEndTime));
    for (LinkData linkData : callerDataMap.getLinkDataList()) {
        LinkCallDataMap linkCallDataMap = linkData.getLinkCallDataMap();
        for (LinkCallData linkCallData : linkCallDataMap.getLinkDataList()) {
            calleStatMap.put(linkCallData.getTarget(), linkCallData);
        }
    }
    init.set(true);
}
Also used : LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) Range(com.navercorp.pinpoint.web.vo.Range) LinkCallData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)

Example 3 with LinkCallData

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData in project pinpoint by naver.

the class MapStatisticsCallerDataCollector method getCountRate.

public long getCountRate(String calleName, DataCategory dataCategory) {
    LinkCallData linkCallData = calleStatMap.get(calleName);
    long count = 0;
    long totalCount = 0;
    if (linkCallData != null) {
        switch(dataCategory) {
            case SLOW_RATE:
                for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
                    count += timeHistogram.getSlowCount();
                    count += timeHistogram.getVerySlowCount();
                    totalCount += timeHistogram.getTotalCount();
                }
                break;
            case ERROR_RATE:
                for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
                    count += timeHistogram.getTotalErrorCount();
                    totalCount += timeHistogram.getTotalCount();
                }
                break;
            default:
                throw new IllegalArgumentException("Can't calculate rate for " + dataCategory.toString());
        }
        return calculatePercent(count, totalCount);
    }
    return 0;
}
Also used : TimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram) LinkCallData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)

Example 4 with LinkCallData

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData in project pinpoint by naver.

the class ApplicationTimeHistogramBuilder method build.

public ApplicationTimeHistogram build(Collection<LinkCallData> linkCallDataMapList) {
    Map<Long, TimeHistogram> applicationLevelHistogram = new HashMap<>();
    for (LinkCallData linkCallData : linkCallDataMapList) {
        for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
            Long timeStamp = timeHistogram.getTimeStamp();
            TimeHistogram histogram = applicationLevelHistogram.get(timeStamp);
            if (histogram == null) {
                histogram = new TimeHistogram(timeHistogram.getHistogramSchema(), timeStamp);
                applicationLevelHistogram.put(timeStamp, histogram);
            }
            histogram.add(timeHistogram);
        }
    }
    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 : LinkCallData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)

Aggregations

LinkCallData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)4 TimeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram)2 LinkCallDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap)1 LinkData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData)1 LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)1 Range (com.navercorp.pinpoint.web.vo.Range)1