From 02fa10634ffabbf79eedcd395e5ec3fdea0cabaf Mon Sep 17 00:00:00 2001 From: thierry Date: Thu, 16 Oct 2014 15:38:20 +1100 Subject: [PATCH] Updated OEDL of exp3 and instructions of exp2 --- gec21_oedl_tutorial/tutorial_2.md | 2 +- gec21_oedl_tutorial/tutorial_3.rb | 36 ++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/gec21_oedl_tutorial/tutorial_2.md b/gec21_oedl_tutorial/tutorial_2.md index a984e87..91aa8a1 100644 --- a/gec21_oedl_tutorial/tutorial_2.md +++ b/gec21_oedl_tutorial/tutorial_2.md @@ -75,7 +75,7 @@ For specific help on using LabWiki, please refer to the [LabWiki introduction pa ![Experiment 2 Result Screenshot](https://raw.githubusercontent.com/mytestbed/gec_demos_tutorial/master/gec21_oedl_tutorial/tutorial_2.fig5.png) -- You may interact to with the graph, e.g. tick or un-tick the legend's keys to display only results from the first or/and second resource, hover the pointer above a graph point to display the underlying data point, drag-and-drop the graph via its icon to the "Plan" panel as described in the [LabWiki introduction page](http://groups.geni.net/geni/wiki/GEC21Agenda/OEDL/Introduction#Execute) +- You may interact to with the graph, e.g. hover the pointer above a graph point to display the underlying data point, drag-and-drop the graph via its icon to the "Plan" panel as described in the [LabWiki introduction page](http://groups.geni.net/geni/wiki/GEC21Agenda/OEDL/Introduction#Execute) - The complete data set holding the measurements collected from this experiment is stored in an SQL database. You can retrieve a copy of that database by clicking on the 'Database Dump' buttom in the 'Execute' panel. The format of that copy is depends on your LabWiki's deployment configuration. It could be an iRODS dump, a Zipped archive of CSV files, a SQLite3 dump or a PostgreSQL dump. By default, it is a PostgreSQL dump. diff --git a/gec21_oedl_tutorial/tutorial_3.rb b/gec21_oedl_tutorial/tutorial_3.rb index 7f8e3fb..2fff89b 100644 --- a/gec21_oedl_tutorial/tutorial_3.rb +++ b/gec21_oedl_tutorial/tutorial_3.rb @@ -3,8 +3,10 @@ # executed. # # - we start by getting the list of resources provisioned for our slice -# - then for each resource, we check that it is a 'node' type of resoures -# - if so, we create a new group for that node resources & add a ping app to it +# - we filter that list of resources to only retain the 'node' ones +# - then we randomly pick a few of these nodes +# - finally, we create a new group with these randomly picked nodes and +# associate a ping app to them # loadOEDL('https://raw.githubusercontent.com/mytestbed/oml4r/master/omf/ping-oml2.rb') @@ -37,23 +39,33 @@ # "type": "node" # available_resources = getResources() +nodes = available_resources.map { |res| res.omf_id if res.type == 'node' }.compact +random_nodes = nodes.sample(2) -available_resources.each do |res| - if res.type == 'node' - info "Got a new resource from Slice: #{res.omf_id} - #{res.type}" - defGroup("Worker"+res.omf_id , res.omf_id) do |group| - group.addApplication("ping") do |app| - app.setProperty('dest_addr', property.target) - app.measure('ping', samples: 1) - end - end +info "------ Found #{available_resources.length} available resources" +info "------ Including #{nodes.length} available nodes" +random_nodes.map { |n| info "------ Randomly picked: #{n}" } + +defGroup("Random_Workers", random_nodes) do |group| + group.addApplication("ping") do |app| + app.setProperty('dest_addr', property.target) + app.measure('ping', samples: 1) end end -onEvent :ALL_UP_AND_INSTALLED do +onEvent :ALL_UP_AND_INSTALLED do allGroups.startApplications after 20 do allGroups.stopApplications Experiment.done end end + +defGraph 'Workers' do |g| + g.ms('ping').select {[ oml_ts_client.as(:time), :rtt, oml_sender_id.as(:name) ]} + g.caption "Ping RTT vs Time, for each Workers" + g.type 'line_chart3' + g.mapping :x_axis => :time, :y_axis => :rtt, :group_by => :name + g.xaxis :legend => 'time [s]' + g.yaxis :legend => 'Ping RTT [ms]', :ticks => {:format => 's'} +end \ No newline at end of file