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());
}
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) {
}
}
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);
}
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());
}
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());
}
Aggregations