Search in sources :

Example 26 with Range

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

the class TimeWindowSlotCentricSamplerTest method getWindowSizeFor_5_minutes.

@Test
public void getWindowSizeFor_5_minutes() {
    // Given
    final long from = START_TIME_STAMP;
    final long to = START_TIME_STAMP + (5 * ONE_MINUTE);
    final Range range = new Range(from, to);
    // When
    final long idealWindowSize = sampler.getWindowSize(range);
    // Then
    assertWindowSizeIsIdeal(from, to, idealWindowSize);
}
Also used : Range(com.navercorp.pinpoint.web.vo.Range) Test(org.junit.Test)

Example 27 with Range

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

the class TimeWindowSlotCentricSamplerTest method getWindowSizeFor_12_hours.

@Test
public void getWindowSizeFor_12_hours() {
    // Given
    final long from = START_TIME_STAMP;
    final long to = START_TIME_STAMP + (12 * ONE_HOUR);
    final Range range = new Range(from, to);
    // When
    final long idealWindowSize = sampler.getWindowSize(range);
    // Then
    assertWindowSizeIsIdeal(from, to, idealWindowSize);
}
Also used : Range(com.navercorp.pinpoint.web.vo.Range) Test(org.junit.Test)

Example 28 with Range

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

the class TimeWindowSlotCentricSamplerTest method getWindowSizeFor_20_minutes.

@Test
public void getWindowSizeFor_20_minutes() {
    // Given
    final long from = START_TIME_STAMP;
    final long to = START_TIME_STAMP + (20 * ONE_MINUTE);
    final Range range = new Range(from, to);
    // When
    final long idealWindowSize = sampler.getWindowSize(range);
    // Then
    assertWindowSizeIsIdeal(from, to, idealWindowSize);
}
Also used : Range(com.navercorp.pinpoint.web.vo.Range) Test(org.junit.Test)

Example 29 with Range

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

the class TimeWindowTest method testWindowSize.

private void testWindowSize(long start, long end) {
    Range range = new Range(start, end);
    TimeWindow window = new TimeWindow(range);
    logger.debug("{}", window.getWindowSlotSize());
}
Also used : Range(com.navercorp.pinpoint.web.vo.Range) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow)

Example 30 with Range

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

the class TimeWindowTest method testGetNextWindow2.

@Test
public void testGetNextWindow2() throws Exception {
    Range range = new Range(1L, TimeUnit.MINUTES.toMillis(1));
    TimeWindow window = new TimeWindow(range);
    int i = 0;
    for (Long aLong : window) {
        logger.debug("{}", aLong);
        i++;
    }
    Assert.assertEquals(i, 2);
}
Also used : Range(com.navercorp.pinpoint.web.vo.Range) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) 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