From d3dd9be1a7beb90d8e697ad8ba3ff8254d5193be Mon Sep 17 00:00:00 2001 From: Jason Ray Date: Tue, 19 Dec 2023 19:04:17 -0500 Subject: [PATCH] use tqdm with publish message --- publish_sample_messages.py | 3 ++- requirements.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/publish_sample_messages.py b/publish_sample_messages.py index 762dd80..ed9a2e3 100644 --- a/publish_sample_messages.py +++ b/publish_sample_messages.py @@ -5,6 +5,7 @@ import random import argparse import time +from tqdm import tqdm parser = argparse.ArgumentParser( prog='publish_sample_messages', @@ -45,7 +46,7 @@ def create_random_message(payload: str): def publish(): Statman.stopwatch(name='publish-sample-messages.timing', autostart=True) - for i in range(0, args.number_of_messages): + for i in tqdm(range(0, args.number_of_messages)): m = create_random_message(payload=f'HellO WorlD {i}') kessel.publish(m) Statman.gauge(name='publish-sample-messages.published-messages').increment() diff --git a/requirements.txt b/requirements.txt index 26c1dcc..9f54d59 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ statman == 1.4.3 pulpo-config == 2.0.1 art == 6.1 -greenstalk==2.0.2 \ No newline at end of file +greenstalk==2.0.2 +tqdm==4.66.0 \ No newline at end of file