Search in sources :

Example 6 with TCmdActiveThreadLightDumpRes

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

the class ActiveThreadLightDumpServiceTest method basicFunctionTest1.

@Test
public void basicFunctionTest1() throws Exception {
    List<WaitingJob> waitingJobList = this.waitingJobListFactory.createList(CREATE_SIZE, JOB_TIMEOUT);
    List<ActiveTraceSnapshot> activeTraceInfoList = createMockActiveTraceInfoList(CREATE_SIZE, DEFAULT_TIME_MILLIS, TIME_DIFF_INTERVAL, waitingJobList);
    ActiveThreadLightDumpService service = createService(activeTraceInfoList);
    TCmdActiveThreadLightDumpRes response = (TCmdActiveThreadLightDumpRes) service.requestCommandService(createRequest(0, null, null));
    Assert.assertEquals(CREATE_SIZE, response.getThreadDumpsSize());
}
Also used : TCmdActiveThreadLightDumpRes(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDumpRes) UnsampledActiveTraceSnapshot(com.navercorp.pinpoint.profiler.context.active.UnsampledActiveTraceSnapshot) ActiveTraceSnapshot(com.navercorp.pinpoint.profiler.context.active.ActiveTraceSnapshot) Test(org.junit.Test)

Example 7 with TCmdActiveThreadLightDumpRes

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

the class ActiveThreadLightDumpServiceTest method basicFunctionTest2.

@Test
public void basicFunctionTest2() throws Exception {
    List<WaitingJob> waitingJobList = this.waitingJobListFactory.createList(CREATE_SIZE, JOB_TIMEOUT);
    List<ActiveTraceSnapshot> activeTraceInfoList = createMockActiveTraceInfoList(CREATE_SIZE, DEFAULT_TIME_MILLIS, TIME_DIFF_INTERVAL, waitingJobList);
    TCmdActiveThreadLightDump tCmdActiveThreadDump = createRequest(0, null, Arrays.asList(1L));
    ActiveThreadLightDumpService service = createService(activeTraceInfoList);
    TCmdActiveThreadLightDumpRes response = (TCmdActiveThreadLightDumpRes) service.requestCommandService(tCmdActiveThreadDump);
    Assert.assertEquals(1, response.getThreadDumpsSize());
}
Also used : TCmdActiveThreadLightDump(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDump) TCmdActiveThreadLightDumpRes(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDumpRes) UnsampledActiveTraceSnapshot(com.navercorp.pinpoint.profiler.context.active.UnsampledActiveTraceSnapshot) ActiveTraceSnapshot(com.navercorp.pinpoint.profiler.context.active.ActiveTraceSnapshot) Test(org.junit.Test)

Example 8 with TCmdActiveThreadLightDumpRes

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

the class ActiveThreadLightDumpServiceTest method basicFunctionTest3.

@Test
public void basicFunctionTest3() throws Exception {
    List<WaitingJob> waitingJobList = this.waitingJobListFactory.createList(CREATE_SIZE, JOB_TIMEOUT);
    int targetThreadNameSize = 3;
    List<ActiveTraceSnapshot> activeTraceInfoList = createMockActiveTraceInfoList(CREATE_SIZE, DEFAULT_TIME_MILLIS, TIME_DIFF_INTERVAL, waitingJobList);
    List<String> threadNameList = extractThreadNameList(activeTraceInfoList, targetThreadNameSize);
    TCmdActiveThreadLightDump tCmdActiveThreadDump = createRequest(0, threadNameList, null);
    ActiveThreadLightDumpService service = createService(activeTraceInfoList);
    TCmdActiveThreadLightDumpRes response = (TCmdActiveThreadLightDumpRes) service.requestCommandService(tCmdActiveThreadDump);
    Assert.assertEquals(3, response.getThreadDumpsSize());
}
Also used : TCmdActiveThreadLightDump(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDump) TCmdActiveThreadLightDumpRes(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDumpRes) UnsampledActiveTraceSnapshot(com.navercorp.pinpoint.profiler.context.active.UnsampledActiveTraceSnapshot) ActiveTraceSnapshot(com.navercorp.pinpoint.profiler.context.active.ActiveTraceSnapshot) Test(org.junit.Test)

Example 9 with TCmdActiveThreadLightDumpRes

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

the class ActiveThreadLightDumpServiceTest method basicFunctionTest5.

@Test
public void basicFunctionTest5() throws Exception {
    List<WaitingJob> waitingJobList = this.waitingJobListFactory.createList(CREATE_SIZE, JOB_TIMEOUT);
    List<ActiveTraceSnapshot> activeTraceInfoList = createMockActiveTraceInfoList(CREATE_SIZE, DEFAULT_TIME_MILLIS, TIME_DIFF_INTERVAL, waitingJobList);
    int limit = 3;
    List<Long> oldTimeList = getOldTimeList(limit);
    TCmdActiveThreadLightDump tCmdActiveThreadDump = createRequest(limit, null, null);
    ActiveThreadLightDumpService service = createService(activeTraceInfoList);
    TCmdActiveThreadLightDumpRes response = (TCmdActiveThreadLightDumpRes) service.requestCommandService(tCmdActiveThreadDump);
    Assert.assertEquals(limit, response.getThreadDumpsSize());
    for (TActiveThreadLightDump dump : response.getThreadDumps()) {
        Assert.assertTrue(oldTimeList.contains(dump.getStartTime()));
    }
}
Also used : TCmdActiveThreadLightDump(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDump) TCmdActiveThreadLightDumpRes(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDumpRes) UnsampledActiveTraceSnapshot(com.navercorp.pinpoint.profiler.context.active.UnsampledActiveTraceSnapshot) ActiveTraceSnapshot(com.navercorp.pinpoint.profiler.context.active.ActiveTraceSnapshot) TActiveThreadLightDump(com.navercorp.pinpoint.thrift.dto.command.TActiveThreadLightDump) Test(org.junit.Test)

Example 10 with TCmdActiveThreadLightDumpRes

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

the class ActiveThreadLightDumpService method requestCommandService.

@Override
public TBase<?, ?> requestCommandService(TBase<?, ?> tBase) {
    TCmdActiveThreadLightDump request = (TCmdActiveThreadLightDump) tBase;
    List<TActiveThreadLightDump> activeThreadDumpList = getActiveThreadDumpList(request);
    TCmdActiveThreadLightDumpRes response = new TCmdActiveThreadLightDumpRes();
    response.setType(ActiveThreadDumpService.JAVA);
    response.setSubType(JvmUtils.getType().name());
    response.setVersion(JvmUtils.getVersion().name());
    response.setThreadDumps(activeThreadDumpList);
    return response;
}
Also used : TCmdActiveThreadLightDump(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDump) TCmdActiveThreadLightDumpRes(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDumpRes) TActiveThreadLightDump(com.navercorp.pinpoint.thrift.dto.command.TActiveThreadLightDump)

Aggregations

TCmdActiveThreadLightDumpRes (com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDumpRes)10 TCmdActiveThreadLightDump (com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDump)8 ActiveTraceSnapshot (com.navercorp.pinpoint.profiler.context.active.ActiveTraceSnapshot)5 UnsampledActiveTraceSnapshot (com.navercorp.pinpoint.profiler.context.active.UnsampledActiveTraceSnapshot)5 TActiveThreadLightDump (com.navercorp.pinpoint.thrift.dto.command.TActiveThreadLightDump)5 Test (org.junit.Test)5 PinpointRouteResponse (com.navercorp.pinpoint.web.cluster.PinpointRouteResponse)2 AgentActiveThreadDumpFactory (com.navercorp.pinpoint.web.vo.AgentActiveThreadDumpFactory)2 AgentActiveThreadDumpList (com.navercorp.pinpoint.web.vo.AgentActiveThreadDumpList)2 AgentInfo (com.navercorp.pinpoint.web.vo.AgentInfo)2 TException (org.apache.thrift.TException)2 PActiveThreadLightDump (com.navercorp.pinpoint.grpc.trace.PActiveThreadLightDump)1 CodeResult (com.navercorp.pinpoint.web.vo.CodeResult)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1