Search in sources :

Example 6 with TCmdActiveThreadDumpRes

use of com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadDumpRes in project pinpoint by naver.

the class ActiveThreadDumpServiceTest method basicFunctionTest4.

@Test
public void basicFunctionTest4() throws Exception {
    List<WaitingJob> waitingJobList = createWaitingJobList(CREATE_SIZE);
    try {
        List<ActiveTraceInfo> activeTraceInfoList = createMockActiveTraceInfoList(CREATE_SIZE, DEFAULT_TIME_MILLIS, TIME_DIFF_INTERVAL, waitingJobList);
        List<ActiveTraceInfo> copied = shuffle(activeTraceInfoList);
        int targetThreadNameSize = 3;
        List<String> threadNameList = extractThreadNameList(copied.subList(0, targetThreadNameSize), targetThreadNameSize);
        int targetTraceIdSize = 3;
        List<Long> localTraceIdList = extractLocalTraceIdList(copied.subList(targetThreadNameSize, CREATE_SIZE), targetTraceIdSize);
        TCmdActiveThreadDump tCmdActiveThreadDump = createRequest(0, threadNameList, localTraceIdList);
        ActiveThreadDumpService service = createService(activeTraceInfoList);
        TCmdActiveThreadDumpRes response = (TCmdActiveThreadDumpRes) service.requestCommandService(tCmdActiveThreadDump);
        Assert.assertEquals(targetThreadNameSize + targetTraceIdSize, response.getThreadDumpsSize());
    } finally {
        clearResource(waitingJobList);
    }
}
Also used : TCmdActiveThreadDump(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadDump) TCmdActiveThreadDumpRes(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadDumpRes) ActiveTraceInfo(com.navercorp.pinpoint.profiler.context.active.ActiveTraceInfo) Test(org.junit.Test)

Example 7 with TCmdActiveThreadDumpRes

use of com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadDumpRes in project pinpoint by naver.

the class ActiveThreadDumpServiceTest method basicFunctionTest2.

@Test
public void basicFunctionTest2() throws Exception {
    List<WaitingJob> waitingJobList = createWaitingJobList(CREATE_SIZE);
    try {
        List<ActiveTraceInfo> activeTraceInfoList = createMockActiveTraceInfoList(CREATE_SIZE, DEFAULT_TIME_MILLIS, TIME_DIFF_INTERVAL, waitingJobList);
        TCmdActiveThreadDump tCmdActiveThreadDump = createRequest(0, null, Arrays.asList(1L));
        ActiveThreadDumpService service = createService(activeTraceInfoList);
        TCmdActiveThreadDumpRes response = (TCmdActiveThreadDumpRes) service.requestCommandService(tCmdActiveThreadDump);
        Assert.assertEquals(1, response.getThreadDumpsSize());
    } finally {
        clearResource(waitingJobList);
    }
}
Also used : TCmdActiveThreadDump(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadDump) TCmdActiveThreadDumpRes(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadDumpRes) ActiveTraceInfo(com.navercorp.pinpoint.profiler.context.active.ActiveTraceInfo) Test(org.junit.Test)

Aggregations

TCmdActiveThreadDumpRes (com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadDumpRes)7 TCmdActiveThreadDump (com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadDump)6 ActiveTraceInfo (com.navercorp.pinpoint.profiler.context.active.ActiveTraceInfo)5 Test (org.junit.Test)5 TActiveThreadDump (com.navercorp.pinpoint.thrift.dto.command.TActiveThreadDump)3 PinpointRouteResponse (com.navercorp.pinpoint.web.cluster.PinpointRouteResponse)1 AgentActiveThreadDumpFactory (com.navercorp.pinpoint.web.vo.AgentActiveThreadDumpFactory)1 AgentActiveThreadDumpList (com.navercorp.pinpoint.web.vo.AgentActiveThreadDumpList)1 AgentInfo (com.navercorp.pinpoint.web.vo.AgentInfo)1 TException (org.apache.thrift.TException)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1