Version 23 (modified by Cong, 9 years ago) (diff)

--

## F. Analyze

In Section F we went through the exercise of retrieving data from iRODS to a local computer. In this Section, we will introduce two different methods that can be used to analyze the measurement data. Analysis of measurement data obtained with OMF/OML is not limited to these two methods, we simply use them for demonstration purposes.

### G.1 R Scripts

One potential way to visualize the data is making use of R, which provides a visualization language. For this tutorial, we have create a set of R script, which we briefly discuss in the following.

The first script creates a plot of the RTTs for each ping that's carried out in the experiment. The following code snipped shows part of the R script that is used to plot a single ping (to 192.168.2.10).

```library(RSQLite)
con <- dbConnect(dbDriver("SQLite"), dbname = "gimi20-2012-10-18t14.03.42-04.00.sq3")
dbListTables(con)

rtt1 <- abs(mydata1\$rtt)

rtt2 <- abs(mydata2\$rtt)

rtt3 <- abs(mydata3\$rtt)

rtt4 <- abs(mydata4\$rtt)

rtt5 <- abs(mydata5\$rtt)

rtt6 <- abs(mydata6\$rtt)

rtt7 <- abs(mydata7\$rtt)

rtt8 <- abs(mydata8\$rtt)

rtt9 <- abs(mydata9\$rtt)

rtt10 <- abs(mydata10\$rtt)

rtt11 <- abs(mydata11\$rtt)

rtt12 <- abs(mydata12\$rtt)

png(filename="gimi20-nmetrics-eth", height=650, width=900,
bg="white")
g_range <- range(0,rtt1,rtt2,rtt3,rtt4,rtt5,rtt6,rtt7,rtt8,rtt9,rtt10,rtt11,rtt12)

plot(rtt1,type="o",col="red",ylim= g_range, lty=2, xlab="Experiment Interval",ylab="RTT")

title(main="nmetrics experiment on ExoGENI (Received Data)", col.main="red", font.main=4)
legend("topright", g_range[4], legend=c("192.168.4.10","192.168.5.12","192.168.4.11","192.168.2.12","192.168.5.11","192.168.2.10","192.168.3.13","192.168.6.14","192.168.1.10","192.168.3.12","192.168.6.12"), cex=0.8,
col=c("blue","red","green","purple","violetred","springgreen","skyblue","sienna","pink","yellow","thistle","orange"), pch=15:16:17:18:19:20:21:22:23:24:25:26, lty=1:2:3:4:5:6:7:8:9:10:11:12);

dev.off()
```

The resulting plot is shown below.

The following script plots otr results from the 4th experiment we executed.

```library(RSQLite)
con <- dbConnect(dbDriver("SQLite"), dbname = "gimi20-otg-nmetrics.sq3")
dbListTables(con)

mydata1 <- dbGetQuery(con, "select oml_sender_id, pkt_length from otr2_udp_in where src_host='192.168.4.10'")
pkt_length <- mydata1\$pkt_length
#plot(rx_bytes1, type="o", color="red", xlab="Experiment Interval", ylab="Received data")

png(filename="gimi20_otg1.png", height=650, width=900,
bg="white")
g_range <- range(0,pkt_length)

plot(pkt_length,type="o",col="red",ylim= g_range, lty=2, xlab="Experiment Interval",ylab="Packet Size")

legend("bottomright", g_range[1], legend=c("interface1"), cex=0.8,
col=c("blue"), pch=21, lty=1);

dev.off()
```

The resulting plot is shown below.

Both scripts are simply executed with:

```R -f <script_name>
```

The following script plots part of nmetrics results from the 4th experiment we executed.

```library(RSQLite)
con <- dbConnect(dbDriver("SQLite"), dbname = "gimi20-otg-nmetrics.sq3")
dbListTables(con)

mydata1 <- dbGetQuery(con, "select oml_sender_id, rx_bytes from nmetrics_net_if where oml_sender_id=1")
rx_bytes1 <- abs(mydata1\$rx_bytes)
#plot(rx_bytes1, type="o", color="red", xlab="Experiment Interval", ylab="Received data")

mydata2 <- dbGetQuery(con, "select oml_sender_id, rx_bytes from nmetrics_net_if where oml_sender_id=2")
rx_bytes2 <- abs(mydata2\$rx_bytes)

mydata3 <- dbGetQuery(con, "select oml_sender_id, rx_bytes from nmetrics_net_if where oml_sender_id=3")
rx_bytes3 <- abs(mydata3\$rx_bytes)

mydata4 <- dbGetQuery(con, "select oml_sender_id, rx_bytes from nmetrics_net_if where oml_sender_id=4")
rx_bytes4 <- abs(mydata4\$rx_bytes)

png(filename="gimi20-nmetrics-eth", height=650, width=900,
bg="white")
g_range <- range(0,rx_bytes1,rx_bytes2,rx_bytes3,rx_bytes4)

plot(rx_bytes1,type="o",col="red",ylim= g_range, lty=2, xlab="Experiment Interval",ylab="Received Data")
title(main="nmetrics experiment on ExoGENI (Received Data)", col.main="red", font.main=4)
legend("bottomright", g_range[4], legend=c("interface1","interface2","interface3","interface4"), cex=0.8,
col=c("blue","red","green","purple"), pch=21:22:23:24, lty=1:2:3:4);
```

The resulting plot is shown below.

Both scripts are simply executed with:

```R -f <script_name>
```

The benefit of using R scripts is that they can produce graphs that can be used in documents!

The results can then be stored into iRODS using the itools presented in Section E.2.

### G.2 omf_web

The second alternative we use in the tutorial is omf_web, which already has been presented in Section D.