use of com.navercorp.pinpoint.web.util.Limiter in project pinpoint by naver.
the class DateLimiterTest method checkFail.
@Test
public void checkFail() {
Limiter limiter = new DateLimiter(2);
try {
limiter.limit(0, TimeUnit.DAYS.toMillis(2) + 1);
Assert.fail();
} catch (Exception ignored) {
}
try {
limiter.limit(TimeUnit.DAYS.toMillis(2), 0);
Assert.fail();
} catch (Exception ignored) {
}
}
use of com.navercorp.pinpoint.web.util.Limiter in project pinpoint by naver.
the class DateLimiterTest method checkRangeFail.
@Test
public void checkRangeFail() {
Limiter limiter = new DateLimiter(2);
try {
limiter.limit(new Range(0, TimeUnit.DAYS.toMillis(2) + 1));
Assert.fail();
} catch (Exception ignored) {
}
try {
limiter.limit(new Range(TimeUnit.DAYS.toMillis(2), 0));
Assert.fail();
} catch (Exception ignored) {
}
}
use of com.navercorp.pinpoint.web.util.Limiter in project pinpoint by naver.
the class DateLimiterTest method check.
@Test
public void check() {
Limiter limiter = new DateLimiter(2);
limiter.limit(0, TimeUnit.DAYS.toMillis(2));
long time = 1000;
limiter.limit(time, time + TimeUnit.DAYS.toMillis(2));
limiter.limit(TimeUnit.DAYS.toMillis(2), TimeUnit.DAYS.toMillis(2));
}
use of com.navercorp.pinpoint.web.util.Limiter in project pinpoint by naver.
the class DateLimiterTest method checkRange.
@Test
public void checkRange() {
Limiter limiter = new DateLimiter(2);
limiter.limit(new Range(0, TimeUnit.DAYS.toMillis(2)));
long time = 1000;
limiter.limit(new Range(time, time + TimeUnit.DAYS.toMillis(2)));
limiter.limit(new Range(TimeUnit.DAYS.toMillis(2), TimeUnit.DAYS.toMillis(2)));
}
Aggregations