Tutorials/g0WmLTE/Tutorial2: iperf2.rb

File iperf2.rb, 7.5 KB (added by dinhquang19991, 11 years ago)

new iperf file (test)

Line 
1defApplication('oml:app:iperf', 'iperf') do |a|
2
3 a.path = "/usr/bin/iperf-oml2"
4 a.version(2, 9, -0) # This is the version of the OML instrumentation, not the base Iperf
5 a.shortDescription = 'Iperf traffic generator and bandwidth measurement tool'
6 a.description = %{
7Iperf is a traffic generator and bandwidth measurement tool. It provides
8generators producing various forms of packet streams and port for sending these
9packets via various transports, such as TCP and UDP.
10 }
11
12 a.defProperty('interval', 'pause n seconds between periodic bandwidth reports',
13 '-i', {:type => :string, :dynamic => false})
14 a.defProperty('len', 'set length read/write buffer to n (default 8 KB)',
15 '-l', {:type => :string, :dynamic => false})
16 a.defProperty('print_mss', 'print TCP maximum segment size (MTU - TCP/IP header)',
17 '-m', {:type => :boolean, :dynamic => false})
18 a.defProperty('output', 'output the report or error message to this specified file',
19 '-o', {:type => :string, :dynamic => false})
20 a.defProperty('port', 'set server port to listen on/connect to to n (default 5001)',
21 '-p', {:type => :integer, :dynamic => false})
22 a.defProperty('udp', 'use UDP rather than TCP',
23 '-u', {:order => 2, :type => :boolean, :dynamic => false})
24 a.defProperty('window', 'TCP window size (socket buffer size)',
25 '-w', {:type => :integer, :dynamic => false})
26 a.defProperty('bind', 'bind to <host>, an interface or multicast address',
27 '-B', {:type => :string, :dynamic => false})
28 a.defProperty('compatibility', 'for use with older versions does not sent extra msgs',
29 '-C', {:type => :boolean, :dynamic => false})
30 a.defProperty('mss', 'set TCP maximum segment size (MTU - 40 bytes)',
31 '-M', {:type => :integer, :dynamic => false})
32 a.defProperty('nodelay', 'set TCP no delay, disabling Nagle\'s Algorithm',
33 '-N', {:type => :boolean, :dynamic => false})
34 a.defProperty('IPv6Version', 'set the domain to IPv6',
35 '-V', {:type => :boolean, :dynamic => false})
36 a.defProperty('reportexclude', '[CDMSV] exclude C(connection) D(data) M(multicast) S(settings) V(server) reports',
37 '-x', {:type => :string, :dynamic => false})
38 a.defProperty('reportstyle', 'C or c for CSV report, O or o for OML',
39 '-y', {:type => :string, :dynamic => false})
40 a.defProperty('server', 'run in server mode',
41 '-s', {:type => :boolean, :dynamic => false})
42
43 a.defProperty('bandwidth', 'set target bandwidth to n bits/sec (default 1 Mbit/sec)',
44 '-b', {:type => :string, :dynamic => false})
45 a.defProperty('client', 'run in client mode, connecting to <host>',
46 '-c', {:order => 1, :type => :string, :dynamic => false})
47 a.defProperty('dualtest', 'do a bidirectional test simultaneously',
48 '-d', {:type => :boolean, :dynamic => false})
49 a.defProperty('num', 'number of bytes to transmit (instead of -t)',
50 '-n', {:type => :integer, :dynamic => false})
51 a.defProperty('tradeoff', 'do a bidirectional test individually',
52 '-r', {:type => :boolean, :dynamic => false})
53 a.defProperty('time', 'time in seconds to transmit for (default 10 secs)',
54 '-t', {:type => :integer, :dynamic => false})
55 a.defProperty('fileinput', 'input the data to be transmitted from a file',
56 '-F', {:type => :string, :dynamic => false})
57 a.defProperty('stdin', 'input the data to be transmitted from stdin',
58 '-I', {:type => :boolean, :dynamic => false})
59 a.defProperty('listenport', 'port to recieve bidirectional tests back on',
60 '-L', {:type => :integer, :dynamic => false})
61 a.defProperty('parallel', 'number of parallel client threads to run',
62 '-P', {:type => :integer, :dynamic => false})
63 a.defProperty('ttl', 'time-to-live, for multicast (default 1)',
64 '-T', {:type => :integer, :dynamic => false})
65 a.defProperty('linux-congestion', 'set TCP congestion control algorithm (Linux only)',
66 '-Z', {:type => :boolean, :dynamic => false})
67
68 a.defMeasurement("application"){ |m|
69 m.defMetric('pid', :integer, 'Main process identifier')
70 m.defMetric('version', :string, 'Iperf version')
71 m.defMetric('cmdline', :string, 'Iperf invocation command line')
72 m.defMetric('starttime_s', :integer, 'Time the application was received (s)')
73 m.defMetric('starttime_us', :integer, 'Time the application was received (us)')
74 }
75 a.defMeasurement("settings"){ |m|
76 m.defMetric('pid', :integer, 'Main process identifier')
77 m.defMetric('server_mode', :integer, '1 if in server mode, 0 otherwise')
78 m.defMetric('bind_address', :string, 'Address to bind')
79 m.defMetric('multicast', :integer, '1 if listening to a Multicast group')
80 m.defMetric('multicast_ttl', :integer, 'Multicast TTL if relevant')
81 m.defMetric('transport_protocol', :integer, 'Transport protocol (IANA number)')
82 m.defMetric('window_size', :integer, 'TCP window size')
83 m.defMetric('buffer_size', :integer, 'UDP buffer size')
84 }
85
86 a.defMeasurement("connection"){ |m|
87 m.defMetric('pid', :integer, 'Main process identifier')
88 m.defMetric('connection_id', :integer, 'Connection identifier (socket)')
89 m.defMetric('local_address', :string, 'Local network address')
90 m.defMetric('local_port', :integer, 'Local port')
91 m.defMetric('remote_address', :string, 'Remote network address')
92 m.defMetric('remote_port', :integer, 'Remote port')
93 }
94
95 a.defMeasurement("transfer"){ |m|
96 m.defMetric('pid', :integer, 'Main process identifier')
97 m.defMetric('connection_id', :integer, 'Connection identifier (socket)')
98 m.defMetric('begin_interval', :float, 'Start of the averaging interval (Iperf timestamp)')
99 m.defMetric('end_interval', :float, 'End of the averaging interval (Iperf timestamp)')
100 m.defMetric('size', :uint64, 'Amount of transmitted data [Bytes]')
101 }
102
103 a.defMeasurement("losses"){ |m|
104 m.defMetric('pid', :integer, 'Main process identifier')
105 m.defMetric('connection_id', :integer, 'Connection identifier (socket)')
106 m.defMetric('begin_interval', :float, 'Start of the averaging interval (Iperf timestamp)')
107 m.defMetric('end_interval', :float, 'End of the averaging interval (Iperf timestamp)')
108 m.defMetric('total_datagrams', :integer, 'Total number of datagrams')
109 m.defMetric('lost_datagrams', :integer, 'Number of lost datagrams')
110 }
111a.defMeasurement("jitter"){ |m|
112 m.defMetric('pid', :integer, 'Main process identifier')
113 m.defMetric('connection_id', :integer, 'Connection identifier (socket)')
114 m.defMetric('begin_interval', :float, 'Start of the averaging interval (Iperf timestamp)')
115 m.defMetric('end_interval', :float, 'End of the averaging interval (Iperf timestamp)')
116 m.defMetric('jitter', :float, 'Average jitter [ms]')
117 }
118
119 a.defMeasurement("packets"){ |m|
120 m.defMetric('pid', :integer, 'Main process identifier')
121 m.defMetric('connection_id', :integer, 'Connection identifier (socket)')
122 m.defMetric('packet_id', :integer, 'Packet sequence number for datagram-oriented protocols')
123 m.defMetric('packet_size', :integer, 'Packet size')
124 m.defMetric('packet_time_s', :integer, 'Time the packet was processed (s)')
125 m.defMetric('packet_time_us', :integer, 'Time the packet was processed (us)')
126 m.defMetric('packet_sent_time_s', :integer, 'Time the packet was sent (s) for datagram-oriented protocols')
127 m.defMetric('packet_sent_time_us', :integer, 'Time the packet was sent (us) for datagram-oriented protocols')
128 }
129
130end