Search in sources :

Example 1 with ActiveTraceInfo

use of com.navercorp.pinpoint.profiler.context.active.ActiveTraceInfo in project pinpoint by naver.

the class ActiveThreadDumpService method getActiveThreadDumpList.

private List<TActiveThreadDump> getActiveThreadDumpList(TCmdActiveThreadDump request, int limit, List<ActiveTraceInfo> activeTraceInfoList) {
    int targetThreadNameListSize = request.getThreadNameListSize();
    int localTraceIdListSize = request.getLocalTraceIdListSize();
    boolean filterEnable = (targetThreadNameListSize + localTraceIdListSize) > 0;
    List<TActiveThreadDump> activeThreadDumpList = new ArrayList<TActiveThreadDump>(Math.min(limit, activeTraceInfoList.size()));
    if (filterEnable) {
        for (ActiveTraceInfo activeTraceInfo : activeTraceInfoList) {
            if (!ActiveThreadDumpUtils.isTraceThread(activeTraceInfo, request.getThreadNameList(), request.getLocalTraceIdList())) {
                continue;
            }
            TActiveThreadDump activeThreadDump = createActiveThreadDump(activeTraceInfo);
            if (activeThreadDump != null) {
                if (limit > activeThreadDumpList.size()) {
                    activeThreadDumpList.add(activeThreadDump);
                }
            }
        }
    } else {
        for (ActiveTraceInfo activeTraceInfo : activeTraceInfoList) {
            TActiveThreadDump activeThreadDump = createActiveThreadDump(activeTraceInfo);
            if (activeThreadDump != null) {
                if (limit > activeThreadDumpList.size()) {
                    activeThreadDumpList.add(activeThreadDump);
                }
            }
        }
    }
    return activeThreadDumpList;
}
Also used : ArrayList(java.util.ArrayList) TActiveThreadDump(com.navercorp.pinpoint.thrift.dto.command.TActiveThreadDump) ActiveTraceInfo(com.navercorp.pinpoint.profiler.context.active.ActiveTraceInfo)

Example 2 with ActiveTraceInfo

use of com.navercorp.pinpoint.profiler.context.active.ActiveTraceInfo in project pinpoint by naver.

the class ActiveThreadLightDumpService method getTActiveThreadDumpList.

private List<TActiveThreadLightDump> getTActiveThreadDumpList(TCmdActiveThreadLightDump request, int limit, List<ActiveTraceInfo> activeTraceInfoList) {
    int targetThreadNameListSize = request.getThreadNameListSize();
    int localTraceIdListSize = request.getLocalTraceIdListSize();
    boolean filterEnable = (targetThreadNameListSize + localTraceIdListSize) > 0;
    List<TActiveThreadLightDump> activeThreadDumpList = new ArrayList<TActiveThreadLightDump>(Math.min(limit, activeTraceInfoList.size()));
    if (filterEnable) {
        for (ActiveTraceInfo activeTraceInfo : activeTraceInfoList) {
            if (!ActiveThreadDumpUtils.isTraceThread(activeTraceInfo, request.getThreadNameList(), request.getLocalTraceIdList())) {
                continue;
            }
            TActiveThreadLightDump activeThreadDump = createActiveLightThreadDump(activeTraceInfo);
            if (activeThreadDump != null) {
                if (limit > activeThreadDumpList.size()) {
                    activeThreadDumpList.add(activeThreadDump);
                }
            }
        }
    } else {
        for (ActiveTraceInfo activeTraceInfo : activeTraceInfoList) {
            TActiveThreadLightDump activeThreadDump = createActiveLightThreadDump(activeTraceInfo);
            if (activeThreadDump != null) {
                if (limit > activeThreadDumpList.size()) {
                    activeThreadDumpList.add(activeThreadDump);
                }
            }
        }
    }
    return activeThreadDumpList;
}
Also used : ArrayList(java.util.ArrayList) ActiveTraceInfo(com.navercorp.pinpoint.profiler.context.active.ActiveTraceInfo) TActiveThreadLightDump(com.navercorp.pinpoint.thrift.dto.command.TActiveThreadLightDump)

Aggregations

ActiveTraceInfo (com.navercorp.pinpoint.profiler.context.active.ActiveTraceInfo)2 ArrayList (java.util.ArrayList)2 TActiveThreadDump (com.navercorp.pinpoint.thrift.dto.command.TActiveThreadDump)1 TActiveThreadLightDump (com.navercorp.pinpoint.thrift.dto.command.TActiveThreadLightDump)1