Skip to content

Commit

Permalink
add 1kw test script
Browse files Browse the repository at this point in the history
  • Loading branch information
yedf committed Aug 22, 2015
1 parent bc5a17c commit 283594f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/1kw-cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import sys
import os
import time

if len(sys.argv) < 7:
print('''usage: %s <host> <begin port> <end port> <conn count> <process count> <heartbeat interval>''' % sys.argv[0])
raise SystemExit(1)

host, begin_port, end_port, conn_count, process_count, heartbeat = sys.argv[1], int(sys.argv[2]), int(sys.argv[3]), int(sys.argv[4]), int(sys.argv[5]), int(sys.argv[6])
for i in range(process_count):
os.system('./1kw-cli %s %d %d %d %d&' % (host, begin_port, end_port, conn_count/process_count, heartbeat))
time.sleep(0.5)

11 changes: 11 additions & 0 deletions examples/1kw-svr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sys
import os

if len(sys.argv) < 4:
print('''usage: %s <begin port> <port count> <process count>''' % sys.argv[0])
raise SystemExit(1)

begin_port, port_count, process_count = int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3])
port_per_process = port_count / process_count
for i in range(process_count):
os.system('./1kw-svr %d %d&' % (begin_port + i * port_per_process, begin_port + (i+1) * port_per_process))

0 comments on commit 283594f

Please sign in to comment.