Search in sources :

Example 71 with Range

use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.

the class AgentStatusTimelineTest method singleLifeCycle_disconnected.

@Test
public void singleLifeCycle_disconnected() {
    // Given
    Range timelineRange = new Range(100, 200);
    List<AgentStatusTimelineSegment> expectedTimelineSegments = Collections.singletonList(createSegment(100, 200, AgentState.RUNNING));
    // When
    long agentA = 0;
    AgentStatus initialStatus = createAgentStatus(90, AgentLifeCycleState.RUNNING);
    AgentStatusTimeline timeline = new AgentStatusTimelineBuilder(timelineRange, initialStatus).from(Arrays.asList(createAgentEvent(agentA, 150, AgentEventType.AGENT_CLOSED_BY_SERVER), createAgentEvent(agentA, 160, AgentEventType.AGENT_CONNECTED), createAgentEvent(agentA, 180, AgentEventType.AGENT_PING))).build();
    // Then
    Assert.assertEquals(expectedTimelineSegments, timeline.getTimelineSegments());
    Assert.assertFalse(timeline.isIncludeWarning());
}
Also used : AgentStatus(com.navercorp.pinpoint.web.vo.AgentStatus) Range(com.navercorp.pinpoint.web.vo.Range) Test(org.junit.Test)

Example 72 with Range

use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.

the class RangeTest method testCreate.

@Test
public void testCreate() {
    Range range1 = new Range(0, 0);
    Range range2 = new Range(0, 1);
    try {
        Range range3 = new Range(0, -1);
        Assert.fail();
    } catch (Exception ignored) {
    }
}
Also used : Range(com.navercorp.pinpoint.web.vo.Range) Test(org.junit.Test)

Example 73 with Range

use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.

the class DataSourceChartGroupTest method basicFunctionTest1.

@Test
public void basicFunctionTest1() throws Exception {
    long currentTimeMillis = System.currentTimeMillis();
    TimeWindow timeWindow = new TimeWindow(new Range(currentTimeMillis - 300000, currentTimeMillis));
    List<SampledDataSource> sampledDataSourceList = createSampledDataSourceList(timeWindow);
    DataSourceChartGroup dataSourceChartGroup = new DataSourceChartGroup(timeWindow, sampledDataSourceList, serviceTypeRegistryService);
    assertEquals(sampledDataSourceList, dataSourceChartGroup);
}
Also used : SampledDataSource(com.navercorp.pinpoint.web.vo.stat.SampledDataSource) Range(com.navercorp.pinpoint.web.vo.Range) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) Test(org.junit.Test)

Example 74 with Range

use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.

the class AgentEventTimelineTest method nullFilter.

@Test
public void nullFilter() {
    // Given
    Range timelineRange = new Range(100, 200);
    List<AgentEvent> agentEvents = Arrays.asList(createAgentEvent(140, AgentEventType.AGENT_PING), createAgentEvent(190, AgentEventType.AGENT_PING));
    List<AgentEventTimelineSegment> expectedTimelineSegments = Collections.singletonList(createSegment(100, 200, agentEvents));
    // When
    AgentEventTimeline timeline = new AgentEventTimelineBuilder(timelineRange, 1).from(agentEvents).addFilter(null).build();
    // Then
    Assert.assertEquals(expectedTimelineSegments, timeline.getTimelineSegments());
}
Also used : Range(com.navercorp.pinpoint.web.vo.Range) AgentEvent(com.navercorp.pinpoint.web.vo.AgentEvent) Test(org.junit.Test)

Example 75 with Range

use of com.navercorp.pinpoint.web.vo.Range in project pinpoint by naver.

the class AgentEventTimelineTest method noFilter.

@Test
public void noFilter() {
    // Given
    Range timelineRange = new Range(100, 200);
    List<AgentEvent> agentEvents = Arrays.asList(createAgentEvent(140, AgentEventType.AGENT_PING), createAgentEvent(190, AgentEventType.AGENT_PING));
    List<AgentEventTimelineSegment> expectedTimelineSegments = Collections.singletonList(createSegment(100, 200, agentEvents));
    // When
    AgentEventTimeline timeline = new AgentEventTimelineBuilder(timelineRange, 1).from(agentEvents).build();
    // Then
    Assert.assertEquals(expectedTimelineSegments, timeline.getTimelineSegments());
}
Also used : Range(com.navercorp.pinpoint.web.vo.Range) AgentEvent(com.navercorp.pinpoint.web.vo.AgentEvent) Test(org.junit.Test)

Aggregations

Range (com.navercorp.pinpoint.web.vo.Range)101 Test (org.junit.Test)62 TimeWindow (com.navercorp.pinpoint.web.util.TimeWindow)23 AgentStatus (com.navercorp.pinpoint.web.vo.AgentStatus)16 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)16 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)15 Application (com.navercorp.pinpoint.web.vo.Application)12 SampledAgentStatResultExtractor (com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor)9 List (java.util.List)8 AgentEvent (com.navercorp.pinpoint.web.vo.AgentEvent)7 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)7 CpuLoadBo (com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo)6 JvmGcBo (com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo)6 AgentStatDataPoint (com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint)5 TimeWindowSlotCentricSampler (com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler)5 LegacyAgentStatChartGroup (com.navercorp.pinpoint.web.vo.stat.chart.LegacyAgentStatChartGroup)5 ArrayList (java.util.ArrayList)5 TimeWindowSampler (com.navercorp.pinpoint.web.util.TimeWindowSampler)4 StopWatch (org.springframework.util.StopWatch)4 ApplicationIndexDao (com.navercorp.pinpoint.web.dao.ApplicationIndexDao)3