Changes between Initial Version and Version 1 of Old/Athstats/ScriptsRepository/AthstatsAppDef


Ignore:
Timestamp:
Feb 10, 2006, 12:15:40 AM (19 years ago)
Author:
kishore
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Old/Athstats/ScriptsRepository/AthstatsAppDef

    v1 v1  
     1[wiki:WikiStart Orbit] > [wiki:OTG OTG] > [wiki:OTG/ScriptsRepository Scripts Repository] > otg.rb
     2
     3{{{
     4
     5#
     6# Create an application representation from scratch
     7#
     8require 'handler/appDefinition'
     9
     10a = AppDefinition.create('test:app:athstats')
     11a.name = "athstats"
     12a.version(0, 0, 1)
     13a.shortDescription = "Application to gather madwifi driver statistics"
     14a.description = <<TEXT
     15This C application gathers driver statistics and reports them.
     16TEXT
     17
     18# addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
     19a.addProperty('interface', 'Use ath0/ath1, ath0 by default', nil, String, false)
     20a.addProperty('interval', 'Number of msec between calls to query driver', nil, String, false)
     21
     22a.addMeasurement("queryport", nil, [
     23  ['succ_tx_attempts','int'],
     24  ['fail_xretries','int'],
     25  ['total_frames_rcvd','int']
     26 ])
     27a.path = "/usr/bin/athstats-oml"
     28
     29if $0 == __FILE__
     30  require 'stringio'
     31  require 'rexml/document'
     32  include REXML
     33
     34  sio = StringIO.new()
     35  a.to_xml.write(sio, 2)
     36  sio.rewind
     37  puts sio.read
     38
     39  sio.rewind
     40  doc = Document.new(sio)
     41  t = AppDefinition.from_xml(doc.root)
     42
     43  puts
     44  puts "-------------------------"
     45  puts
     46  t.to_xml.write($stdout, 2)
     47
     48end
     49
     50
     51}}}