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 13
13
parser = argparse .ArgumentParser ()
14
14
parser .add_argument ('--msize' , default = 1000 , type = int ,
15
15
help = 'message size in bytes' )
16
+ parser .add_argument ('--mpr' , default = 1 , type = int ,
17
+ help = 'messages per request' )
16
18
parser .add_argument ('--num' , default = 200000 , type = int ,
17
19
help = 'number of messages' )
18
20
parser .add_argument ('--times' , default = 1 , type = int ,
34
36
print ('will connect to: {}' .format (addr ))
35
37
36
38
MSGSIZE = args .msize
39
+ REQSIZE = MSGSIZE * args .mpr
37
40
38
41
msg = b'x' * (MSGSIZE - 1 ) + b'\n '
42
+ if args .mpr :
43
+ msg *= args .mpr
39
44
40
45
def run_test (n ):
41
46
print ('Sending' , NMESSAGES , 'messages' )
47
+ if args .mpr :
48
+ n //= args .mpr
49
+
42
50
if unix :
43
51
sock = socket (AF_UNIX , SOCK_STREAM )
44
52
else :
@@ -53,8 +61,8 @@ def run_test(n):
53
61
while n > 0 :
54
62
sock .sendall (msg )
55
63
nrecv = 0
56
- while nrecv < MSGSIZE :
57
- resp = sock .recv (MSGSIZE )
64
+ while nrecv < REQSIZE :
65
+ resp = sock .recv (REQSIZE )
58
66
if not resp :
59
67
raise SystemExit ()
60
68
nrecv += len (resp )
You can’t perform that action at this time.
0 commit comments