Skip to content

Commit

Permalink
Merge pull request #4940 from mmaslankaprv/update-client-swarm
Browse files Browse the repository at this point in the history
Updated client swarm version
  • Loading branch information
dotnwat committed May 31, 2022
2 parents 0a7cbd0 + e0d598d commit 431290b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
export PATH="/root/.cargo/bin:${PATH}" && \
git clone https://github.com/redpanda-data/client-swarm.git && \
cd client-swarm && \
git reset --hard 9427df19 && \
git reset --hard 28790f8 && \
cargo build --release && \
cp target/release/client-swarm /usr/local/bin && \
cd .. && rm -rf client-swarm && rm -rf /root/.cargo
Expand Down
19 changes: 14 additions & 5 deletions tests/rptest/services/producer_swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,27 @@


class ProducerSwarm(BackgroundThreadService):
def __init__(self, context, redpanda, topic: str, producers: int,
records_per_producer: int):
def __init__(self,
context,
redpanda,
topic: str,
producers: int,
records_per_producer: int,
log_level="INFO",
properties={}):
super(ProducerSwarm, self).__init__(context, num_nodes=1)
self._redpanda = redpanda
self._topic = topic
self._producers = producers
self._records_per_producer = records_per_producer
self._stopping = threading.Event()
self._log_level = log_level
self._properties = properties

def _worker(self, idx, node):
cmd = f"RUST_LOG=INFO client-swarm producers {self._redpanda.brokers()} {self._topic} {self._producers} {self._records_per_producer}"

cmd = f"RUST_LOG={self._log_level} client-swarm --brokers {self._redpanda.brokers()} producers --topic {self._topic} --count {self._producers} --messages {self._records_per_producer}"
for k, v in self._properties.items():
cmd += f" --properties {k}={v}"
try:
for line in node.account.ssh_capture(cmd):
self.logger.debug(line.rstrip())
Expand All @@ -41,4 +50,4 @@ def stop_all(self):
self.stop()

def stop_node(self, node):
node.account.kill_process("conn_test", clean_shutdown=False)
node.account.kill_process("client-swarm", clean_shutdown=False)

0 comments on commit 431290b

Please sign in to comment.