|   | 1 | {{{ | 
          
          
            |   | 2 | # | 
          
          
            |   | 3 | # Define a prototype | 
          
          
            |   | 4 | # | 
          
          
            |   | 5 | require 'handler/prototype' | 
          
          
            |   | 6 | require 'handler/filter' | 
          
          
            |   | 7 | require 'handler/appDefinition' | 
          
          
            |   | 8 |  | 
          
          
            |   | 9 | p = Prototype.create("test:proto:itgdecoder") | 
          
          
            |   | 10 | p.name = "ITG Decoder" | 
          
          
            |   | 11 | p.description = "Decodes output and prints results" | 
          
          
            |   | 12 | p.defProperty('logfile', 'Logfile') | 
          
          
            |   | 13 | p.defProperty('tput_report_interval', 'Report interval for throughput') | 
          
          
            |   | 14 | p.defProperty('delay_report_interval', 'Report interval for Delay') | 
          
          
            |   | 15 | p.defProperty('jitter_report_interval', 'Report interval for Jitter') | 
          
          
            |   | 16 | p.defProperty('loss_report_interval', 'Report interval for Packet loss') | 
          
          
            |   | 17 |  | 
          
          
            |   | 18 | itgd = p.addApplication('itgdec', "test:app:itgdec") | 
          
          
            |   | 19 | itgd.bindProperty('logfile') | 
          
          
            |   | 20 | itgd.bindProperty('d', 'delay_report_interval') | 
          
          
            |   | 21 | itgd.bindProperty('j', 'jitter_report_interval') | 
          
          
            |   | 22 | itgd.bindProperty('b', 'tput_report_interval') | 
          
          
            |   | 23 | itgd.bindProperty('p', 'loss_report_interval') | 
          
          
            |   | 24 |  | 
          
          
            |   | 25 | itgd.addMeasurement('decoderport',  Filter::SAMPLE,  | 
          
          
            |   | 26 |   {Filter::SAMPLE_SIZE => 1}, | 
          
          
            |   | 27 |   [ | 
          
          
            |   | 28 |     ['flow_no'], | 
          
          
            |   | 29 |     ['src_port'], | 
          
          
            |   | 30 |     ['dst_port'], | 
          
          
            |   | 31 |     ['throughput'], | 
          
          
            |   | 32 |     ['jitter'], | 
          
          
            |   | 33 |     ['delay'], | 
          
          
            |   | 34 |     ['pkt_loss'], | 
          
          
            |   | 35 |     ['rssi'], | 
          
          
            |   | 36 |     ['rate'] | 
          
          
            |   | 37 |   ] | 
          
          
            |   | 38 | ) | 
          
          
            |   | 39 |  | 
          
          
            |   | 40 | if $0 == __FILE__ | 
          
          
            |   | 41 |   p.to_xml.write($stdout, 2) | 
          
          
            |   | 42 |   puts | 
          
          
            |   | 43 | end | 
          
          
            |   | 44 |  | 
          
          
            |   | 45 | }}} |