4 | | == How do I configure OML measurement collection via nodehandler? == |
| 4 | == 1) Demystifying the addMeasurement method == |
| 5 | '''addMeasurement in Application definition''' : |
| 6 | Application definition is created by the application developer. The application developer chooses what measurements will be generated by the application, how they will be grouped and what name to give to the measurement group. An experimenter has no control over this. This is the "WHAT" of measurement collection. The application writer decides what measurements will be generated by the application. |
| 7 | |
| 8 | In the example for OTG application definition found here : |
| 9 | http://www.orbit-lab.org/userdoc/wiki/OTG/ScriptsRepository/OtgAppDef |
| 10 | {{{ |
| 11 | a.addMeasurement("senderport", nil, [ |
| 12 | ['pkt_seqno', 'long'], |
| 13 | ['pkt_size', 'long'], |
| 14 | ['gen_timestamp', Float], |
| 15 | ['tx_timestamp', 'long'] |
| 16 | ]) |
| 17 | }}} |
| 18 | There is a measurement group called "senderport" which is defined by the application developer. This group has 4 metrics that are being measured, namely: pkt_seqno, pkt_size, gen_timestamp and tx_timestamp. Again these metrics and their datatypes are decided by the application developer. |
| 19 | |
| 20 | |
| 21 | '''addMeasurement in Prototype definition''' : |
| 22 | As an experimenter you read what measurements are available to you in a particular application. The application definition has the comprehensive list of measurement groups and the metrics listed within each group. |
| 23 | The experimenter controls which measurements to use in the experiment and how to process them or filter them, via a prototype. He or she can use one of the predefined prototypes or create their own. Think of the prototypes as the "Avatars" that you define to control the "HOW" of measurement collection i.e. HOW often the measurements will be aggregated and which of them you are interested in and how you want to filter them. |
| 24 | |
| 25 | So if you look at a sample prototype like sender.rb which uses the otg application : |
| 26 | http://svn.orbit-lab.org/projects/orbit/wiki/OTG/ScriptsRepository/ProtoDefSender |
| 27 | {{{ |
| 28 | otg = p.addApplication(:otg, "test:app:otg") |
| 29 | }}} |
| 30 | Here you add the application otg to your prototype. |
| 31 | |
| 32 | {{{ |
| 33 | otg.addMeasurement('senderport', Filter::TIME, |
| 34 | {Filter::SAMPLE_SIZE => 1}, |
| 35 | [ |
| 36 | ['pkt_seqno'], |
| 37 | ['pkt_size', Filter::SUM], |
| 38 | ['gen_timestamp'], |
| 39 | ['tx_timestamp'] |
| 40 | ] |
| 41 | }}} |
| 42 | |
| 43 | Here you are specifying that your prototype will use the the "senderport" measurement group and that you want TIME based aggregation every one second and want to apply SUM filter to the pkt_size metric. |
| 44 | You can only specify a measurement group or metric that is part of the application definition that you are using. You can't make up your own. |
| 45 | |
| 46 | |
| 47 | == 2) How do I configure OML measurement collection via nodehandler? == |