Skip to content

Commit

Permalink
Merge pull request #27 from jlouis/jlouis-initial-R
Browse files Browse the repository at this point in the history
Introduce R as a tool for graphing.
  • Loading branch information
ericmoritz committed Jun 18, 2012
2 parents aa17d3e + e9dfae6 commit 9a3c81e
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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/
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.PHONY: build report stats

build:
./rebar get-deps compile

report:
./bin/compile_all_stats.sh

stats:
$(MAKE) -C stats stats
19 changes: 19 additions & 0 deletions stats/Makefile
Original file line number Diff line number Diff line change
@@ -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

27 changes: 27 additions & 0 deletions stats/stats.r
Original file line number Diff line number Diff line change
@@ -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.