OML4R: Native OML Implementation in Ruby
This is a simple client library for OML which does not use liboml2 and its filters, but connects directly to the server using the text protocol omsp. User can use this library to create ruby applications which can send measurement to the OML collection server. A simple example on how to use this library is attached at the end of this file. Another example can be found in the file oml4r-example.rb .
OML4R is available from RubyGems oml4r-rubygem.
$ gem install oml4r
Definition of a Measurement Point
class MyMP < :: name :mymp param :mystring param :myint, :type => :int32 param :mydouble, :type => :double end
Initialisation, Injection and Tear-down
::(ARGV, :appName => 'oml4rSimpleExample', :domain => 'foo', :nodeID => 'n1', ) MyMP.inject("hello", 13, 37.1) ::()
It is sometimes desirable to send different measurement points to different collectors. OML4R supports this with the 'channel' abstraction.
class A_MP < :: name :a channel :default param :a_val, :type => :int32 end class B_MP < :: name :b channel :archive channel :default param :b_val, :type => :int32 end ::(ARGV, :appName => 'doubleAgent', :domain => 'foo' ) ::(:archive, 'file:/tmp/archive.log')
Setting the command line flag '--oml-collect' will define a ':default' channel. Any additional channels need to be declared with 'OML4R::create_channel' which takes two arguments, the name of the channel and the destination for the measurement stream. The above example defines an 'archive' channel which is being collected in the local '/tmp/archive.log' file.
Please note that by declaring a specific channel, every MP needs at least one channel declaration.
See examples files oml4r-simple-example.rb and oml4r-wlanconfig.rb.
Please see LICENSE.txt