Skip to content

Commit

Permalink
Merge pull request #401 from rabbitmq/millisecond-for-ramp-up-period
Browse files Browse the repository at this point in the history
Use millisecond granularity for publisher ramp-up period
  • Loading branch information
acogoluegnes authored Oct 5, 2022
2 parents b0772a8 + 67929a6 commit c56dabf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/rabbitmq/perf/MulticastSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,9 @@ PRODUCER_THREAD_PREFIX, nbThreadsForProducerScheduledExecutorService(params)
Supplier<Duration> startDelaySupplier;
if (params.getProducerRandomStartDelayInSeconds() > 0) {
Random random = new Random();
startDelaySupplier = () -> Duration.ofSeconds(
random.nextInt(params.getProducerRandomStartDelayInSeconds()) + 1
int bound = params.getProducerRandomStartDelayInSeconds() * 1000;
startDelaySupplier = () -> Duration.ofMillis(
random.nextInt(bound) + 1
);
} else {
startDelaySupplier = () -> Duration.ZERO;
Expand Down

0 comments on commit c56dabf

Please sign in to comment.