Class RateLimiterServiceImpl
- java.lang.Object
-
- dev.jora.quicloadgenerator.controllers.RateLimiterServiceImpl
-
- All Implemented Interfaces:
RateLimiterService
public class RateLimiterServiceImpl extends java.lang.Object implements RateLimiterService
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.github.bucket4j.BucketcreateBucket(int rps)static RateLimiterServiceinstance(int rps)voidrunByCount(java.util.concurrent.Callable<CommonResponse> callable, int count, java.io.File outFile)voidrunBySeconds(java.util.concurrent.Callable<CommonResponse> callable, int seconds, java.io.File outFile)
-
-
-
Method Detail
-
instance
public static RateLimiterService instance(int rps)
-
createBucket
public io.github.bucket4j.Bucket createBucket(int rps)
-
runByCount
public void runByCount(java.util.concurrent.Callable<CommonResponse> callable, int count, java.io.File outFile) throws java.lang.InterruptedException
- Specified by:
runByCountin interfaceRateLimiterService- Throws:
java.lang.InterruptedException
-
runBySeconds
public void runBySeconds(java.util.concurrent.Callable<CommonResponse> callable, int seconds, java.io.File outFile) throws java.lang.InterruptedException
- Specified by:
runBySecondsin interfaceRateLimiterService- Throws:
java.lang.InterruptedException
-
-