Search in sources :

Example 1 with LoadFactor

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

the class FilteredMapServiceImpl method linkStatistics.

@Override
@Deprecated
public LoadFactor linkStatistics(Range range, List<TransactionId> traceIdSet, Application sourceApplication, Application destinationApplication, Filter filter) {
    if (sourceApplication == null) {
        throw new NullPointerException("sourceApplication must not be null");
    }
    if (destinationApplication == null) {
        throw new NullPointerException("destApplicationName must not be null");
    }
    if (filter == null) {
        throw new NullPointerException("filter must not be null");
    }
    StopWatch watch = new StopWatch();
    watch.start();
    List<List<SpanBo>> originalList = this.traceDao.selectAllSpans(traceIdSet);
    List<SpanBo> filteredTransactionList = filterList(originalList, filter);
    LoadFactor statistics = new LoadFactor(range);
    // scan transaction list
    for (SpanBo span : filteredTransactionList) {
        if (sourceApplication.equals(span.getApplicationId(), registry.findServiceType(span.getApplicationServiceType()))) {
            List<SpanEventBo> spanEventBoList = span.getSpanEventBoList();
            if (spanEventBoList == null) {
                continue;
            }
            // find dest elapsed time
            for (SpanEventBo spanEventBo : spanEventBoList) {
                if (destinationApplication.equals(spanEventBo.getDestinationId(), registry.findServiceType(spanEventBo.getServiceType()))) {
                    // find exception
                    boolean hasException = spanEventBo.hasException();
                    // add sample
                    // TODO : need timeslot value instead of the actual value
                    statistics.addSample(span.getStartTime() + spanEventBo.getStartElapsed(), spanEventBo.getEndElapsed(), 1, hasException);
                    break;
                }
            }
        }
    }
    watch.stop();
    logger.info("Fetch link statistics elapsed. {}ms", watch.getLastTaskTimeMillis());
    return statistics;
}
Also used : LoadFactor(com.navercorp.pinpoint.web.vo.LoadFactor) ArrayList(java.util.ArrayList) List(java.util.List) SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo) StopWatch(org.springframework.util.StopWatch)

Aggregations

SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)1 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)1 LoadFactor (com.navercorp.pinpoint.web.vo.LoadFactor)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 StopWatch (org.springframework.util.StopWatch)1