21 | | <li>we use only 1 resources, which will run a sine signal generator</li> |
22 | | <li>this signal generators is configured to collect and report the sine values</li> |
23 | | <li>we define a custom event which will trigger when the absolute value of the last measurement is above an arbitrary threshold of 0.99. The Experiment Controller will periodically monitor the collected measurements to check for this condition</li> |
24 | | <li>we also define some tasks to execute when this event is triggered. In this case, the task is to send one ICMP ping packet to a target host (using the same instrumented ping application as in the first part of this tutorial).</li> |
25 | | <li>we finally display both measurements from the sine generator and the ICMP ping packets, as a graph showing the sine values and a table showing ping’s timestamp and RTT, respectively. Thus the table’s number of rows should be equal to the graph’s number of positive and negative peaks.</li> |
| 20 | <li>we start with 4 resources, i.e. 2 initial ‘workers’ and 2 backup ones</li> |
| 21 | <li>all workers have a ping application associated to them</li> |
| 22 | <li>the 2 initial workers starts their ping applications</li> |
| 23 | <li>we define a custom event which will trigger when a running ping application is stopped. The Experiment Controller will periodically monitor the state of all resources to check for this condition</li> |
| 24 | <li>furthermore, we define a set of tasks to execute if the event is triggered. In this case, the task is to start a new ping application on one of the backup resources.</li> |
| 25 | <li>every 20 seconds, we purposely stop the ping application running on one of the initial workers</li> |
| 26 | <li>we display a graph of the ping’s RTT for each of the 4 resources and observe that a new ping instance starts when a previously running one is stopped</li> |
56 | | <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#loadOEDL"><strong>loadOEDL</strong></a> (line 16–17). This command includes in your OEDL experiment other external OEDL scripts. In this example, we are loading the definition of a signal generator and ping application (both instrumented with <a href="http://oml.mytestbed.net">OML</a>)</p></li> |
57 | | <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defProperty-38-property-38-ensureProperty"><strong>defProperty</strong></a> (line 19–20). This command defines experiment properties (aka variables), you can set the values of these properties as parameters for each experiment trials, and access them throughout the entire experiment run. In this example, we are defining 2 properties, to hold the name of the resource to use and the target for the ping application.</p></li> |
58 | | <li><p><strong>Some internal variables</strong> (line 21). This is a simple Ruby command that defines an array to hold the list of signal peaks throughout the experiment’s execution. As opposed to the above defProperty variables, internal variables cannot be set at the start of each experiment trial (without having to change the content of the OEDL script itself)</p></li> |
59 | | <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defGroup"><strong>defGroup</strong></a> (line 23–36). This command is used to define a group of resources which we will use in this experiment. A group may contain many resources or any other group, and a resource may be included in many groups. This commands may also be used to associate a set of configurations and applications to all resources in a group. In this example, we define a first group ‘Generator’ with only one resource, then we associate an instrumented signal generator to it. This association is done using the <a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defGroup"><strong>addApplication</strong></a>. Furthermore, we also define a second group ‘Pinger’, which contains the same resource as the first group, but which has an instrumented ping application associated to it.</p></li> |
60 | | <li><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defEvent"><strong>defEvent</strong></a> (line 40–62). This command defines the name of a user’s custom event and the block of conditions which will be used to check if this event should be triggered. |
| 57 | <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#loadOEDL"><strong>loadOEDL</strong></a> (line 12). This command is used to include in your OEDL experiment other external OEDL scripts. In this example, we are loading the definition of a ping application, which has been instrumented with <a href="http://oml.mytestbed.net">OML</a></p></li> |
| 58 | <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defProperty-38-property-38-ensureProperty"><strong>defProperty</strong></a> (line 14–18). This command is used to define experiment properties (aka variables), you can set the values of these properties as parameters for each experiment trials, and access them throughout the entire experiment run. In this example, we are defining 5 properties, to hold the names of each of the resources that we will use and the target for the ping application.</p></li> |
| 59 | <li><p><strong>Some internal variables</strong> (line 21–29). These are classic simple Ruby commands that allow us put all our resource in a single list, then split that list into one holding the ‘initial’ resources, and one holding the ‘backup’ resources. As opposed to the above defProperty variables, these internal variables cannot be set at the start of each experiment trial (without having to change the content of the OEDL script itself)</p></li> |
| 60 | <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defGroup"><strong>defGroup</strong></a> (line 32–41). This command is used to define a group of resources which we will use in this experiment. A group may contain many resources or any other group, and a resource may be included in many groups. This commands may also be used to associate a set of configurations and applications to all resources in a group. In this example, we first define 4 groups (e.g. ‘Worker_X’), each with only one resource, then we are associating an instrumented ping to the unique resource in each group. This association is done using the <a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defGroup"><strong>addApplication</strong></a>. Furthermore, we also define a final group (‘Initial_Worker’), which will contain the ‘Worker’ groups with the initial resources.</p></li> |
| 61 | <li><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defEvent"><strong>defEvent</strong></a> (line 23–53). This command defines the name of a user’s custom event and the block of conditions which will be used to check if this event should be triggered. |
63 | | <li>First since the measurements are being collected as the experiment is running, we need to specify how frequently the Experiment Controller should query the collected measurements to check for the conditions. This is set using the ‘every:’ parameter of <strong>defEvent</strong> (in second).</li> |
64 | | <li>Within the condition block we have two different syntax to access some of the collected measurements: |
65 | | |
66 | | <ul> |
67 | | <li>one option (line 51) is to use the SQL syntax to directly write a query for the measurement database using the command <strong>defQuery</strong>. As many experimenter may be familiar with SQL, this option gives them a very flexible mechanism to access any collected data. The caveat is that they need to know the names of the database tables corresponding to their experiment’s measurement points. This is usually of the form “ApplicationName_MeasurementPoint” (e.g. signalgen_sin in line 51.</li> |
68 | | <li>the other option (line 44–45) is to use a <a href="http://sequel.jeremyevans.net/rdoc/files/doc/querying_rdoc.html">Ruby Sequel syntax</a>. The method <strong>ms(arg)</strong> returns a Measurement Point model, on which any Sequel querying methods can be applied. The resulting query is then passed to the <strong>defQuery</strong> command.</li> |
| 64 | <li>Within the condition block we have access to the ‘state’ variable, which holds a array. Each element of that array represents a resource and is a hash of key/value pairs corresponding to each properties of that resource.</li> |
| 65 | <li>In this example, in our condition block we check for each resource if it failed before. If not we check if is an application and if it is currently stopped. If so then we add it to the list of failed resource, and we trigger the event.</li> |
70 | | <li>The returned data is an array where each element represents a measurement sample. Each sample is in turn a hash where each key represents a metric of that sample. The remaining of the condition block in this example (line 53–59) checks if the absolute value of the last sample is greather than 0.99, and triggers the event if so.</li> |
71 | | </ul></li> |
72 | | <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#onEvent"><strong>onEvent</strong></a> (line 64–66). This command declares the set of actions to perform when a specific event is triggered. In this example, the event is our previously defined “SINE_ABOVE_THRESHOLD”. The actions to perform in this case is to select start a ping application. There is another <strong>onEvent</strong> declaration further (line 68–75), for the event “APP_UP_AND_INSTALLED”, i.e. when all resources are ready to receive commands and all applications associated to them are installed. When this event triggers, we start the signal generator application on the resource within the ‘Generator’ group, then after 60 seconds we stop all applications and terminate the experiment trial.</p></li> |
73 | | <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defGraph"><strong>defGraph</strong></a> (line 77–91). This commands defines the graphs that will be displayed while the experiment trial is running. In this example, we define one graph showing the generated sine values against time, and one table showing the timestamp and RTT of from each sent ICMP ping packet. These graph and table will be updated using measurements enabled in the previous defGroup blocks.</p></li> |
| 67 | <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#onEvent"><strong>onEvent</strong></a> (line 55–61). This command declares the set of actions to perform when a specific event is triggered. In this example, the event is our previously defined “APP_EXITED”. The actions to perform in this case is to select a backup resource and start its ping application. There is another <strong>onEvent</strong> declaration further (line 68–74), for the event “APP_UP_AND_INSTALLED”, i.e. when all resources are ready to receive commands and all applications associated to them are installed. When this event triggers, we start the ping application on the resources within the ‘Initial_Worker’ group, then after 60 seconds we stop all applications and terminate the experiment trial.</p></li> |
| 68 | <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defGraph"><strong>defGraph</strong></a> (line 76–83). This commands defines the graphs that will be displayed while the experiment trial is running. In this example, we define 1 graph showing the RTT values from the ping applications against time for each resources in our experiment. This graph will be drawn using measurements enabled in the previous defGroup blocks.</p></li> |