| 1 | {{{ |
| 2 | # |
| 3 | # Create an application representation from scratch |
| 4 | # |
| 5 | require 'handler/appDefinition' |
| 6 | |
| 7 | a = AppDefinition.create('test:app:iperfr') |
| 8 | a.name = "iperfr" |
| 9 | a.version(0, 0, 1) |
| 10 | a.shortDescription = "Iperf traffic generator" |
| 11 | a.description = <<TEXT |
| 12 | Iperf is a traffic generator for TCP and UDP traffic. It contains generators |
| 13 | producing various forms of packet streams and port for sending |
| 14 | these packets via various transports, such as TCP and UDP. |
| 15 | TEXT |
| 16 | |
| 17 | # addProperty(name, description, mnemonic, type, isDynamic = false, constraints |
| 18 | = nil) |
| 19 | a.addProperty('udp', 'Use UDP, otherwise TCP by default', nil, String, false) |
| 20 | a.addProperty('server', 'Client/Server', nil, String, false) |
| 21 | a.addProperty('port', 'Receiver port number', nil, Integer, false) |
| 22 | a.addProperty('window', 'TCP Receiver Window Size', nil, Integer, false) |
| 23 | a.addProperty('time', "Duration for traffic generation(seconds)", nil, Integer, |
| 24 | false) |
| 25 | a.addProperty('len', "Payload Length(bytes)", nil, Integer, false) |
| 26 | a.addProperty('interval', "Interval between reports (sec)", nil, Integer, false) |
| 27 | |
| 28 | a.addMeasurement("receiverport", nil, [ |
| 29 | ['flow_no','int'], |
| 30 | ['throughput',Float], |
| 31 | ['jitter',Float], |
| 32 | ['packet_loss',Float] |
| 33 | ]) |
| 34 | a.path = "/usr/bin/iperf" |
| 35 | |
| 36 | if $0 == __FILE__ |
| 37 | require 'stringio' |
| 38 | |
| 39 | }}} |