From feb8b3effa5663c69d2be8a28dd558070beb13cc Mon Sep 17 00:00:00 2001 From: TzeYiing Date: Fri, 26 Jan 2024 09:05:24 +0800 Subject: [PATCH] feat: randomized batch sizes --- lib/pipeline.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pipeline.ex b/lib/pipeline.ex index c65bcd0..3538506 100644 --- a/lib/pipeline.ex +++ b/lib/pipeline.ex @@ -17,12 +17,12 @@ defmodule Loadfest.Pipeline do end def handle_demand(demand, state) when demand > 0 do - # num = Enum.random([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 50, 50, 50, 250]) + num = Enum.random([1, 50, 250]) messages = for _i <- 1..demand do %Broadway.Message{ - data: Loadfest.Worker.make_batch(1), + data: Loadfest.Worker.make_batch(num), acknowledger: {__MODULE__, :ack, 3} } end