diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-06-19 09:22:11 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-06-19 09:22:11 +0200 |
commit | 5b77a41eafe6501a3f7cc76f2c746858036aef81 (patch) | |
tree | 6c4d0fbdde979a1ebf0ed2a3f1ea517b14d6d1e1 /perf | |
parent | 4b60023b96d25571f58e50899a2717da14866e6b (diff) |
Throughput tests fixed.
Introduction of subscription forwarding have broken throughput tests.
This patch changes the pattern used in the tests to PUSH/PULL.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'perf')
-rw-r--r-- | perf/inproc_thr.cpp | 10 | ||||
-rw-r--r-- | perf/local_thr.cpp | 8 | ||||
-rw-r--r-- | perf/remote_thr.cpp | 4 |
3 files changed, 4 insertions, 18 deletions
diff --git a/perf/inproc_thr.cpp b/perf/inproc_thr.cpp index 0fa32f5..4673eba 100644 --- a/perf/inproc_thr.cpp +++ b/perf/inproc_thr.cpp @@ -48,7 +48,7 @@ static void *worker (void *ctx_) int i; zmq_msg_t msg; - s = zmq_socket (ctx_, ZMQ_PUB); + s = zmq_socket (ctx_, ZMQ_PUSH); if (!s) { printf ("error in zmq_socket: %s\n", zmq_strerror (errno)); exit (1); @@ -127,18 +127,12 @@ int main (int argc, char *argv []) return -1; } - s = zmq_socket (ctx, ZMQ_SUB); + s = zmq_socket (ctx, ZMQ_PULL); if (!s) { printf ("error in zmq_socket: %s\n", zmq_strerror (errno)); return -1; } - rc = zmq_setsockopt (s, ZMQ_SUBSCRIBE , "", 0); - if (rc != 0) { - printf ("error in zmq_setsockopt: %s\n", zmq_strerror (errno)); - return -1; - } - rc = zmq_bind (s, "inproc://thr_test"); if (rc != 0) { printf ("error in zmq_bind: %s\n", zmq_strerror (errno)); diff --git a/perf/local_thr.cpp b/perf/local_thr.cpp index b5379d8..a21707f 100644 --- a/perf/local_thr.cpp +++ b/perf/local_thr.cpp @@ -52,18 +52,12 @@ int main (int argc, char *argv []) return -1; } - s = zmq_socket (ctx, ZMQ_SUB); + s = zmq_socket (ctx, ZMQ_PULL); if (!s) { printf ("error in zmq_socket: %s\n", zmq_strerror (errno)); return -1; } - rc = zmq_setsockopt (s, ZMQ_SUBSCRIBE , "", 0); - if (rc != 0) { - printf ("error in zmq_setsockopt: %s\n", zmq_strerror (errno)); - return -1; - } - // Add your socket options here. // For example ZMQ_RATE, ZMQ_RECOVERY_IVL and ZMQ_MCAST_LOOP for PGM. diff --git a/perf/remote_thr.cpp b/perf/remote_thr.cpp index 363ae7c..c8df333 100644 --- a/perf/remote_thr.cpp +++ b/perf/remote_thr.cpp @@ -50,7 +50,7 @@ int main (int argc, char *argv []) return -1; } - s = zmq_socket (ctx, ZMQ_PUB); + s = zmq_socket (ctx, ZMQ_PUSH); if (!s) { printf ("error in zmq_socket: %s\n", zmq_strerror (errno)); return -1; @@ -88,8 +88,6 @@ int main (int argc, char *argv []) } } -zmq_sleep (2); - rc = zmq_close (s); if (rc != 0) { printf ("error in zmq_close: %s\n", zmq_strerror (errno)); |