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