cztop 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/perf/local_lat.rb DELETED
@@ -1,35 +0,0 @@
1
- #! /usr/bin/env ruby
2
- require "cztop"
3
- require "benchmark"
4
-
5
- if ARGV.size != 3
6
- abort <<MSG
7
- Usage: #{$0} <bind-to> <message-size> <roundtrip-count>
8
- MSG
9
- end
10
-
11
- ENDPOINT = ARGV[0]
12
- MSG_SIZE = Integer(ARGV[1]) # bytes
13
- ROUNDTRIP_COUNT = Integer(ARGV[2]) # round trips
14
- MSG = "X" * MSG_SIZE
15
-
16
- s = CZTop::Socket::REP.new(ENDPOINT)
17
-
18
- # synchronize
19
- s.wait
20
- s.signal
21
-
22
- tms = Benchmark.measure do
23
- ROUNDTRIP_COUNT.times do
24
- msg = s.receive
25
- raise "wrong message size" if msg.content_size != MSG_SIZE
26
- s << msg
27
- end
28
- end
29
-
30
- elapsed = tms.real
31
- latency = elapsed / (ROUNDTRIP_COUNT * 2) * 1_000_000
32
- puts "message size: #{MSG_SIZE} [B]"
33
- puts "roundtrip count: #{ROUNDTRIP_COUNT}"
34
- puts "elapsed time: %.3f [s]" % elapsed
35
- puts "average latency: %.3f [us]" % latency
data/perf/remote_lat.rb DELETED
@@ -1,26 +0,0 @@
1
- #! /usr/bin/env ruby
2
- require "cztop"
3
- require "benchmark"
4
-
5
- if ARGV.size != 3
6
- abort <<MSG
7
- Usage: #{$0} <connect-to> <message-size> <roundtrip-count>
8
- MSG
9
- end
10
-
11
- ENDPOINT = ARGV[0]
12
- MSG_SIZE = Integer(ARGV[1]) # bytes
13
- ROUNDTRIP_COUNT = Integer(ARGV[2]) # round trips
14
- MSG = "X" * MSG_SIZE
15
-
16
- s = CZTop::Socket::REQ.new(ENDPOINT)
17
-
18
- # synchronize
19
- s.signal
20
- s.wait
21
-
22
- ROUNDTRIP_COUNT.times do
23
- s << MSG
24
- msg = s.receive
25
- raise "wrong message size" if msg.content_size != MSG_SIZE
26
- end