Skip to content

Commit

Permalink
feat: randomized batch sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziinc committed Jan 26, 2024
1 parent d692a32 commit feb8b3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pipeline.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit feb8b3e

Please sign in to comment.