Skip to content

Commit

Permalink
chore: clean up config
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveigah committed May 20, 2024
1 parent 04a503e commit 72e264d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 65 deletions.
72 changes: 12 additions & 60 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,25 @@ config :klife,
]
],
producers: [
%{
name: :my_batch_producer,
client_id: "my_custom_client_id",
linger_ms: 1_500
},
%{
name: :benchmark_producer_in_flight,
client_id: "my_custom_client_id",
max_in_flight_requests: 10
},
%{
name: :my_batch_compressed_producer,
client_id: "my_custom_client_id",
linger_ms: 1_500,
compression_type: :snappy
},
%{
name: :benchmark_producer,
client_id: "my_custom_client_id"
},
%{
name: :batcher_benchmark_producer_1,
name: :benchmark_producer_in_flight,
client_id: "my_custom_client_id",
batchers_count: 1
max_in_flight_requests: 10
},
%{
name: :batcher_benchmark_producer_2,
name: :test_batch_producer,
client_id: "my_custom_client_id",
batchers_count: 2
linger_ms: 1_500
},
%{
name: :batcher_benchmark_producer_3,
name: :test_batch_compressed_producer,
client_id: "my_custom_client_id",
batchers_count: 3
linger_ms: 1_500,
compression_type: :snappy
}
],
topics: [
Expand All @@ -65,49 +50,16 @@ config :klife,
replication_factor: 2
},
%{
name: "comression_topic",
producer: :my_batch_compressed_producer
},
%{
name: "batcher_benchmark_topic_1",
producer: :batcher_benchmark_producer_1,
num_partitions: 30,
replication_factor: 2
},
%{
name: "batcher_benchmark_topic_2",
producer: :batcher_benchmark_producer_2,
num_partitions: 30,
replication_factor: 2
},
%{
name: "batcher_benchmark_topic_3",
producer: :batcher_benchmark_producer_3,
num_partitions: 30,
replication_factor: 2
},
%{
name: "benchmark_topic_2",
producer: :benchmark_producer,
num_partitions: 6,
replication_factor: 2
},
%{
name: "my_batch_topic",
name: "test_batch_topic",
enable_produce: true,
producer: :my_batch_producer
producer: :test_batch_producer
},
%{
name: "topic_b",
enable_produce: true
},
%{
name: "topic_c",
enable_produce: true,
producer: :my_batch_producer
name: "test_compression_topic",
producer: :test_batch_compressed_producer
},
%{
name: "my_no_batch_topic",
name: "test_no_batch_topic",
enable_produce: true
}
]
Expand Down
10 changes: 5 additions & 5 deletions test/producer/producer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule Klife.ProducerTest do
}

cluster = :my_test_cluster_1
topic = "my_no_batch_topic"
topic = "test_no_batch_topic"

assert {:ok, offset} = Producer.produce_sync(record, topic, 1, cluster)

Expand All @@ -49,7 +49,7 @@ defmodule Klife.ProducerTest do
}

cluster = :my_test_cluster_1
topic = "my_no_batch_topic"
topic = "test_no_batch_topic"

assert {:ok, offset} =
Producer.produce_sync(record, topic, 1, cluster, producer: :benchmark_producer)
Expand All @@ -61,7 +61,7 @@ defmodule Klife.ProducerTest do

test "produce message sync with batch" do
cluster = :my_test_cluster_1
topic = "my_batch_topic"
topic = "test_batch_topic"

wait_batch_cycle(cluster, topic)

Expand Down Expand Up @@ -122,7 +122,7 @@ defmodule Klife.ProducerTest do

test "produce message sync with batch and compression" do
cluster = :my_test_cluster_1
topic = "comression_topic"
topic = "test_compression_topic"

wait_batch_cycle(cluster, topic)

Expand Down Expand Up @@ -188,7 +188,7 @@ defmodule Klife.ProducerTest do

test "is able to recover from cluster changes" do
cluster = :my_test_cluster_1
topic = "my_no_batch_topic"
topic = "test_no_batch_topic"

record = %{
value: :rand.bytes(10),
Expand Down

0 comments on commit 72e264d

Please sign in to comment.