Skip to content

Commit

Permalink
use tqdm with publish message
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonray committed Dec 20, 2023
1 parent addd86b commit d3dd9be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion publish_sample_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import random
import argparse
import time
from tqdm import tqdm

parser = argparse.ArgumentParser(
prog='publish_sample_messages',
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
statman == 1.4.3
pulpo-config == 2.0.1
art == 6.1
greenstalk==2.0.2
greenstalk==2.0.2
tqdm==4.66.0

0 comments on commit d3dd9be

Please sign in to comment.