Permalink
Browse files

Merge pull request #27 from jlouis/jlouis-initial-R

Introduce R as a tool for graphing.
  • Loading branch information...
ericmoritz committed Jun 18, 2012
2 parents aa17d3e + e9dfae6 commit 9a3c81e7ee6cdbd9e45d6373c56f4032834332a2
Showing with 63 additions and 11 deletions.
  1. +12 −11 .gitignore
  2. +5 −0 Makefile
  3. +19 −0 stats/Makefile
  4. +27 −0 stats/stats.r
View
@@ -1,15 +1,16 @@
+#*#
+*.beam
+*.class
+*.hi
+*.o
+*.plt
+*~
.*
+competition/log/*.log
+competition/wsdemo-snap
data/
-dist/
-results/
deps/
+dist/
ebin/
-competition/log/*.log
-competition/wsdemo-snap
-*.o
-*.beam
-*.plt
-*.hi
-*~
-#*#
-*.class
+results/
+stats/stat_results/
View
@@ -1,5 +1,10 @@
+.PHONY: build report stats
+
build:
./rebar get-deps compile
report:
./bin/compile_all_stats.sh
+
+stats:
+ $(MAKE) -C stats stats
View
@@ -0,0 +1,19 @@
+.PHONY = all stats dirs
+
+all: stats
+
+stats: dirs counts.csv
+ R CMD BATCH stats.r
+
+dirs:
+ mkdir -p stat_results
+
+clean:
+ rm -f counts.csv
+ rm -f *.Rout
+ rm -f stat_results/*.pdf
+
+counts.csv:
+ echo "type, clients, handshakes, connection_timeouts, messages_sent, messages_recv, crashes" > counts.csv
+ for k in ../data/*/counts.csv; do tail -n 1 "$$k" >> counts.csv ; done
+
View
@@ -0,0 +1,27 @@
+# R-script for producing statistics output:
+# Before runnning this script, makes sure you have the right packages installed:
+# install.packages("ggplot2")
+
+# Make sure needed libraries are there
+require(ggplot2)
+
+# Set some global variables
+base_size <- 9
+
+# Read in data
+counts <- read.csv("counts.csv", header=TRUE)
+
+# First plot, connection timeouts
+pdf("stat_results/conn_timeouts.pdf")
+conn_timeouts <- ggplot(counts, aes(x = type, y = connection_timeouts))
+(conn_timeouts
+ + geom_bar()
+ + xlab('Framework')
+ + ylab('Connections Lost')
+ + opts(axis.ticks = theme_blank(),
+ axis.text.x = theme_text(size = base_size * 0.8,
+ angle = 330,
+ hjust = 0,
+ colour = "grey50")))
+dev.off()
+

0 comments on commit 9a3c81e

Please sign in to comment.