Search in sources :

Example 1 with DeadlockThreadCountBo

use of com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo in project pinpoint by naver.

the class ThriftDeadlockThreadCountBoMapper method map.

@Override
public void map(AgentStatBo.Builder.StatBuilder agentStatBuilder, TAgentStat tAgentStat) {
    // deadlock
    if (tAgentStat.isSetDeadlock()) {
        DeadlockThreadCountBo deadlockThreadCountBo = this.map(tAgentStat.getDeadlock());
        agentStatBuilder.addDeadlockThreadCount(deadlockThreadCountBo);
    }
}
Also used : DeadlockThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo)

Example 2 with DeadlockThreadCountBo

use of com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo in project pinpoint by naver.

the class AgentWarningStatServiceTest method createMockData.

private List<DeadlockThreadCountBo> createMockData(int mockSize, long interval) {
    long timestamp = ThreadLocalRandom.current().nextLong(START_TIME, CURRENT_TIME);
    List<DeadlockThreadCountBo> deadlockThreadCountBoList = new ArrayList<>(mockSize);
    for (int i = 0; i < mockSize; i++) {
        DeadlockThreadCountBo deadlockThreadCountBo = new DeadlockThreadCountBo();
        deadlockThreadCountBo.setAgentId("pinpoint");
        deadlockThreadCountBo.setStartTimestamp(START_TIME);
        deadlockThreadCountBo.setTimestamp(timestamp + (i * interval));
        deadlockThreadCountBoList.add(deadlockThreadCountBo);
    }
    return deadlockThreadCountBoList;
}
Also used : ArrayList(java.util.ArrayList) DeadlockThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo)

Example 3 with DeadlockThreadCountBo

use of com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo in project pinpoint by naver.

the class AgentWarningStatServiceTest method selectTest1.

@Test
public void selectTest1() {
    Range range = Range.newRange(CURRENT_TIME - TIME, CURRENT_TIME);
    List<DeadlockThreadCountBo> mockData = createMockData(10, 5000);
    when(deadlockDao.getAgentStatList("pinpoint", range)).thenReturn(mockData);
    List<AgentStatusTimelineSegment> timelineSegmentList = agentWarningStatService.select("pinpoint", range);
    Assert.assertEquals(1, timelineSegmentList.size());
}
Also used : AgentStatusTimelineSegment(com.navercorp.pinpoint.web.vo.timeline.inspector.AgentStatusTimelineSegment) DeadlockThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo) Range(com.navercorp.pinpoint.web.vo.Range) Test(org.junit.Test)

Example 4 with DeadlockThreadCountBo

use of com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo in project pinpoint by naver.

the class GrpcDeadlockThreadCountBoMapper method map.

@Override
public void map(AgentStatBo.Builder.StatBuilder builder, PAgentStat agentStat) {
    // deadlock
    if (agentStat.hasDeadlock()) {
        final PDeadlock deadlock = agentStat.getDeadlock();
        final DeadlockThreadCountBo deadlockThreadCountBo = this.map(deadlock);
        builder.addDeadlockThreadCount(deadlockThreadCountBo);
    }
}
Also used : DeadlockThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo) PDeadlock(com.navercorp.pinpoint.grpc.trace.PDeadlock)

Example 5 with DeadlockThreadCountBo

use of com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo in project pinpoint by naver.

the class GrpcDeadlockThreadCountBoMapper method map.

public DeadlockThreadCountBo map(final PDeadlock tDeadlock) {
    final DeadlockThreadCountBo deadlockThreadCountBo = new DeadlockThreadCountBo();
    deadlockThreadCountBo.setDeadlockedThreadCount(tDeadlock.getCount());
    return deadlockThreadCountBo;
}
Also used : DeadlockThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo)

Aggregations

DeadlockThreadCountBo (com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo)9 Range (com.navercorp.pinpoint.web.vo.Range)3 AgentStatusTimelineSegment (com.navercorp.pinpoint.web.vo.timeline.inspector.AgentStatusTimelineSegment)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 PDeadlock (com.navercorp.pinpoint.grpc.trace.PDeadlock)1 SampledAgentStatResultExtractor (com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor)1 Point (com.navercorp.pinpoint.web.vo.chart.Point)1 SampledDeadlock (com.navercorp.pinpoint.web.vo.stat.SampledDeadlock)1