| | 1 | [wiki:WikiStart Orbit] > [wiki:Athstats Athstats] > [wiki:Athstats/ScriptsRepository Scripts Repository] > driverqueryapp.rb |
| | 2 | |
| | 3 | {{{ |
| | 4 | |
| | 5 | # |
| | 6 | # Define a prototype |
| | 7 | # |
| | 8 | require 'handler/prototype' |
| | 9 | require 'handler/filter' |
| | 10 | require 'handler/appDefinition' |
| | 11 | |
| | 12 | p = Prototype.create("test:proto:driverqueryapp") |
| | 13 | p.name = "Wireless Driver Stats" |
| | 14 | p.description = "Statistics obtained by querying the driver periodically" |
| | 15 | p.defProperty('interface', 'interface to gather stats from') |
| | 16 | p.defProperty('interval', 'How often to query the driver') |
| | 17 | |
| | 18 | athstats = p.addApplication(:athstats, "test:app:athstats") |
| | 19 | athstats.bindProperty('interface') |
| | 20 | athstats.bindProperty('interval') |
| | 21 | |
| | 22 | athstats.addMeasurement('queryport', Filter::SAMPLE, |
| | 23 | {Filter::SAMPLE_SIZE => 1}, |
| | 24 | [ |
| | 25 | ['succ_tx_attempts'], |
| | 26 | ['fail_xretries'], |
| | 27 | ['total_frames_rcvd'] |
| | 28 | ] |
| | 29 | ) |
| | 30 | |
| | 31 | if $0 == __FILE__ |
| | 32 | p.to_xml.write($stdout, 2) |
| | 33 | puts |
| | 34 | end |
| | 35 | |
| | 36 | }}} |