--- /dev/null
+/log/
+/out/
--- /dev/null
+#!/bin/bash
+
+if test $# -ne 1; then
+ echo "Usage: $0 input-log-file" 1>&2
+ exit 1
+fi
+
+input_log_file=$1
+
+./parse_memory_process < $input_log_file > mp_$input_log_file
+./parse_memory_system < $input_log_file > ms_$input_log_file
+./parse_cpu_process < $input_log_file > cp_$input_log_file
+./parse_cpu_system < $input_log_file > cs_$input_log_file
+./parse_io_process < $input_log_file > ip_$input_log_file
+./parse_io_system < $input_log_file > is_$input_log_file
+./parse_udp_in < $input_log_file > ui_$input_log_file
+./parse_udp_out < $input_log_file > uo_$input_log_file
+./parse_packets_in < $input_log_file > pi_$input_log_file
+./parse_packets_out < $input_log_file > po_$input_log_file
--- /dev/null
+#!/bin/bash
+
+awk '
+BEGIN {
+ count = 0
+ init = 1
+ printf "user\tsystem\tCPU\n"
+}
+
+/%CPU[ \t]+CPU[ \t]+Command/ {
+ count = 0
+ init = 0
+}
+
+{
+ count++
+ if (count == 2 && !init)
+ printf "%s\t%s\t%s\n", $4, $5, $6
+}
+'
--- /dev/null
+#!/bin/bash
+
+awk '
+BEGIN {
+ count = 0
+ init = 1
+ printf "user\tsystem\n"
+}
+
+/^avg-cpu/ {
+ count = 0
+ init = 0
+}
+
+{
+ count++
+ if (count == 2 && !init)
+ printf "%s\t%s\n", $1, $3
+}
+'
--- /dev/null
+#!/bin/bash
+
+awk '
+BEGIN {
+ count = 0
+ init = 1
+ printf "kB_rd/s\tkB_wr/s\n"
+}
+
+/kB_rd\/s[ \t]+kB_wr\/s/ {
+ count = 0
+ init = 0
+}
+
+{
+ count++
+ if (count == 2 && !init)
+ printf "%s\t%s\n", $4, $5
+}
+'
--- /dev/null
+#!/bin/bash
+
+awk '
+BEGIN {
+ count = 0
+ init = 1
+ printf "Blk_read/s\tBlk_wrtn/s\n"
+}
+
+/^Device:/ {
+ count = 0
+ init = 0
+}
+
+{
+ count++
+ if (count == 2 && !init)
+ printf "%s\t%s\n", $3, $4
+}
+'
--- /dev/null
+#!/bin/bash
+
+awk '
+BEGIN {
+ count = 0
+ init = 1
+ printf "VSZ\tRSS\tPERCENT\n"
+}
+
+/VSZ[ \t]+RSS[ \t]+%MEM/ {
+ count = 0
+ init = 0
+}
+
+{
+ count++
+ if (count == 2 && !init)
+ printf "%s\t%s\t%s\n", $6, $7, $8
+}
+'
--- /dev/null
+#!/bin/bash
+
+awk '
+BEGIN {
+ count = 0
+ init = 1
+ printf "memory\n"
+}
+
+/^Mem:/ {
+ count = 0
+ init = 0
+}
+
+{
+ count++
+ if (count == 2 && !init)
+ printf "%s\n", $3
+}
+'
--- /dev/null
+#!/bin/bash
+
+awk '
+BEGIN {
+ count = 0
+ init = 1
+ printf "bytes_received\n"
+}
+
+/^Chain udp_out/ {
+ count = 0
+ init = 0
+}
+
+{
+ count++
+ if (count == 4 && !init)
+ printf "%s\n", $1
+}
+'
--- /dev/null
+#!/bin/bash
+
+awk '
+BEGIN {
+ count = 0
+ init = 1
+ printf "bytes_sent\n"
+}
+
+/^Chain udp_out/ {
+ count = 0
+ init = 0
+}
+
+{
+ count++
+ if (count == 5 && !init)
+ printf "%s\n", $1
+}
+'
--- /dev/null
+#!/bin/bash
+
+awk '
+BEGIN {
+ count = 0
+ init = 1
+ printf "pkts\tbytes\n"
+}
+
+/^Chain udp_in/ {
+ count = 0
+ init = 0
+}
+
+{
+ count++
+
+ pkts = $1 + 0
+ bytes = $2 + 0
+
+ if (index($1, "K"))
+ pkts = pkts * 1024
+ else
+ if (index($1, "M"))
+ pkts = pkts * 1024 * 1024;
+ else
+ if (index($1, "G"))
+ pkts = pkts * 1024 * 1024 * 1204
+
+ if (index($2, "K"))
+ bytes = bytes * 1024
+ else
+ if (index($2, "M"))
+ bytes = bytes * 1024 * 1024;
+ else
+ if (index($2, "G"))
+ bytes = bytes * 1024 * 1024 * 1204
+
+ if (count == 3 && !init)
+ printf "%s\t%s\n", pkts, bytes
+}
+'
--- /dev/null
+#!/bin/bash
+
+awk '
+BEGIN {
+ count = 0
+ init = 1
+ printf "pkts\tbytes\n"
+}
+
+/^Chain udp_out/ {
+ count = 0
+ init = 0
+}
+
+{
+ count++
+
+ pkts = $1 + 0
+ bytes = $2 + 0
+
+ if (index($1, "K"))
+ pkts = pkts * 1024
+ else
+ if (index($1, "M"))
+ pkts = pkts * 1024 * 1024;
+ else
+ if (index($1, "G"))
+ pkts = pkts * 1024 * 1024 * 1204
+
+ if (index($2, "K"))
+ bytes = bytes * 1024
+ else
+ if (index($2, "M"))
+ bytes = bytes * 1024 * 1024;
+ else
+ if (index($2, "G"))
+ bytes = bytes * 1024 * 1024 * 1204
+
+ if (count == 3 && !init)
+ printf "%s\t%s\n", pkts, bytes
+}
+'
--- /dev/null
+#!/bin/bash
+
+if test $# -ne 1; then
+ echo "Usage: $0 base-log-file" 1>&2
+ exit 1
+fi
+
+base_log_file=$1
+
+Rscript r_parse_udp.R out/ui_$base_log_file out/ui_$(basename $base_log_file .log).pdf
+Rscript r_parse_udp.R out/uo_$base_log_file out/uo_$(basename $base_log_file .log).pdf
+Rscript r_parse_cp.R out/cp_$base_log_file out/cp_$(basename $base_log_file .log).pdf
+Rscript r_parse_mp.R out/mp_$base_log_file out/mp_$(basename $base_log_file .log).pdf
--- /dev/null
+args <- commandArgs(trailingOnly=TRUE)
+
+source_file <- args[1]
+output_file <- args[2]
+
+cpu_table <- read.table(source_file, header=T)
+
+cpu_perc <- cpu_table$CPU
+
+cpu_perc
+
+pdf(file=output_file)
+plot(cpu_perc, type="o", col="red", xlab="Time (s)", ylab="CPU Usage (%)");
+dev.off()
--- /dev/null
+args <- commandArgs(trailingOnly=TRUE)
+
+source_file <- args[1]
+output_file <- args[2]
+
+mem_table <- read.table(source_file, header=T)
+
+rss <- mem_table$RSS / 1024
+new_rss <- rss
+new_rss[length(new_rss)+1] = 0
+
+rss
+
+pdf(file=output_file)
+plot(new_rss, type="o", col="red", xlab="Time (s)", ylab="RSS (MB)");
+dev.off()
--- /dev/null
+args <- commandArgs(trailingOnly=TRUE)
+
+source_file <- args[1]
+output_file <- args[2]
+
+udp_table <- read.table(source_file, header=T)
+
+bytes_array <- udp_table$bytes
+offset_bytes_array <- bytes_array[2:length(bytes_array)]
+
+speed <- (offset_bytes_array - bytes_array[1:length(bytes_array)-1]) / 1024
+
+speed
+
+pdf(file=output_file)
+plot(speed, type="o", col="red", xlab="Time (s)", ylab="Speed (KB/s)");
+dev.off()