Search in sources :

Example 6 with DeadlockThreadCountBo

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

the class DeadlockChartGroupTest method createDeadlock.

private SampledDeadlock createDeadlock(long timestamp) {
    int listSize = RandomUtils.nextInt(1, RANDOM_LIST_MAX_SIZE);
    int deadlockedSize = RandomUtils.nextInt(1, RANDOM_MAX_DEADLOCKED_SIZE);
    List<DeadlockThreadCountBo> deadlockThreadCountBoList = new ArrayList<>(listSize);
    for (int i = 0; i < listSize; i++) {
        DeadlockThreadCountBo deadlockThreadCountBo = new DeadlockThreadCountBo();
        deadlockThreadCountBo.setDeadlockedThreadCount(deadlockedSize + i);
        deadlockThreadCountBoList.add(deadlockThreadCountBo);
    }
    return sampler.sampleDataPoints(0, timestamp, deadlockThreadCountBoList, null);
}
Also used : ArrayList(java.util.ArrayList) DeadlockThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo) Point(com.navercorp.pinpoint.web.vo.chart.Point)

Example 7 with DeadlockThreadCountBo

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

the class AgentWarningStatServiceTest method selectTest2.

@Test
public void selectTest2() {
    Range range = Range.newRange(CURRENT_TIME - TIME, CURRENT_TIME);
    List<DeadlockThreadCountBo> mockData = createMockData(10, 70000);
    when(deadlockDao.getAgentStatList("pinpoint", range)).thenReturn(mockData);
    List<AgentStatusTimelineSegment> timelineSegmentList = agentWarningStatService.select("pinpoint", range);
    Assert.assertEquals(10, 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 8 with DeadlockThreadCountBo

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

the class HbaseSampledDeadlockDaoV2 method getSampledAgentStatList.

@Override
public List<SampledDeadlock> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
    long scanFrom = timeWindow.getWindowRange().getFrom();
    long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
    Range range = Range.newRange(scanFrom, scanTo);
    AgentStatMapperV2<DeadlockThreadCountBo> mapper = operations.createRowMapper(deadlockDecoder, range);
    SampledAgentStatResultExtractor<DeadlockThreadCountBo, SampledDeadlock> resultExtractor = new SampledAgentStatResultExtractor<>(timeWindow, mapper, deadlockSampler);
    return operations.getSampledAgentStatList(AgentStatType.DEADLOCK, resultExtractor, agentId, range);
}
Also used : SampledAgentStatResultExtractor(com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor) SampledDeadlock(com.navercorp.pinpoint.web.vo.stat.SampledDeadlock) DeadlockThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo) Range(com.navercorp.pinpoint.web.vo.Range)

Example 9 with DeadlockThreadCountBo

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

the class ThriftDeadlockThreadCountBoMapper method map.

@Override
public DeadlockThreadCountBo map(TDeadlock tDeadlock) {
    DeadlockThreadCountBo deadlockThreadCountBo = new DeadlockThreadCountBo();
    deadlockThreadCountBo.setDeadlockedThreadCount(tDeadlock.getDeadlockedThreadCount());
    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