blob: bb04161741863d08397df1f4c6b637233334d0dd [file] [log] [blame]
Alexander Afanasyev27370c52013-03-12 13:54:08 -07001#!/usr/bin/env Rscript
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -08002# Copyright (c) 2012-2015 Alexander Afanasyev <alexander.afanasyev@ucla.edu>
Alexander Afanasyev27370c52013-03-12 13:54:08 -07003
4
5# install.packages ('ggplot2')
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -08006library(ggplot2)
Alexander Afanasyev27370c52013-03-12 13:54:08 -07007## # install.packages ('scales')
8## library (scales)
9
10#########################
11# Rate trace processing #
12#########################
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080013data = read.table("drop-trace.txt", header=T)
14data$Node = factor(data$Node)
Alexander Afanasyev27370c52013-03-12 13:54:08 -070015data$Kilobits <- data$Kilobytes * 8
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080016data$Type = factor(data$Type)
Alexander Afanasyev27370c52013-03-12 13:54:08 -070017
18## data.rtr = data[grep("Rtr", data$Node),]
19
20# graph rates on all nodes in Kilobits
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080021g.all <- ggplot(data, aes(x=Time, y=Kilobits, color=Type)) +
22 geom_point(size=2) +
23 geom_line() +
24 ylab("Packet drop rate [Kbits/s]") +
25 facet_wrap(~ Node) +
26 theme_bw()
Alexander Afanasyev27370c52013-03-12 13:54:08 -070027
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080028png("src/ndnSIM/docs/source/_static/l2-rate-tracer.png", width=800, height=500)
29print(g.all)
30x = dev.off()