File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1313 parser = argparse .ArgumentParser ()
1414 parser .add_argument ('--msize' , default = 1000 , type = int ,
1515 help = 'message size in bytes' )
16+ parser .add_argument ('--mpr' , default = 1 , type = int ,
17+ help = 'messages per request' )
1618 parser .add_argument ('--num' , default = 200000 , type = int ,
1719 help = 'number of messages' )
1820 parser .add_argument ('--times' , default = 1 , type = int ,
3436 print ('will connect to: {}' .format (addr ))
3537
3638 MSGSIZE = args .msize
39+ REQSIZE = MSGSIZE * args .mpr
3740
3841 msg = b'x' * (MSGSIZE - 1 ) + b'\n '
42+ if args .mpr :
43+ msg *= args .mpr
3944
4045 def run_test (n ):
4146 print ('Sending' , NMESSAGES , 'messages' )
47+ if args .mpr :
48+ n //= args .mpr
49+
4250 if unix :
4351 sock = socket (AF_UNIX , SOCK_STREAM )
4452 else :
@@ -53,8 +61,8 @@ def run_test(n):
5361 while n > 0 :
5462 sock .sendall (msg )
5563 nrecv = 0
56- while nrecv < MSGSIZE :
57- resp = sock .recv (MSGSIZE )
64+ while nrecv < REQSIZE :
65+ resp = sock .recv (REQSIZE )
5866 if not resp :
5967 raise SystemExit ()
6068 nrecv += len (resp )
You can’t perform that action at this time.
0 commit comments