Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Jlouis initial r #29

Merged
merged 5 commits into from

2 participants

@jlouis

More stuff on top of the R code already pushed.

I was quite interested in the boxplot (and jittered box) and we now have those. I am also producing both PDFs and PNGs. Still needs more work, but this is another layer on top of the first one. I am only attacking handshake time at the moment. The latencies proves to be a quite large amount of data to load and mangle :)

@ericmoritz
Owner

Can you merge in master and fix the conflicts so that I apply this request?

@jlouis

Sure, but will be tomorrow. Heading for bed :)

@ericmoritz
Owner

No problem, I'll do it manually

@ericmoritz ericmoritz merged commit 7dbe2b4 into from
@ericmoritz
Owner

Wow, github is magical. I merged your branch from the command line and this pull request automatically switched to closed.

@jlouis

Yep, GH for you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 18, 2012
  1. @jlouis
  2. @jlouis
  3. @jlouis

    Prefer log10 scales all over.

    jlouis authored
    Otherwise the trend is really hard to see...
  4. @jlouis

    Use a trick from basho-bench.

    jlouis authored
    Automatically install missing packages.
  5. @jlouis

    Volcano plots.

    jlouis authored
This page is out of date. Refresh to see the latest.
Showing with 110 additions and 16 deletions.
  1. +2 −0  .gitignore
  2. +10 −3 stats/Makefile
  3. +98 −13 stats/stats.r
View
2  .gitignore
@@ -6,6 +6,7 @@
*.plt
*~
.*
+*.Rout
competition/log/*.log
competition/wsdemo-snap
data/
@@ -14,3 +15,4 @@ dist/
ebin/
results/
stats/stat_results/
+stats/*.csv
View
13 stats/Makefile
@@ -2,18 +2,25 @@
all: stats
-stats: dirs counts.csv
+stats: dirs counts.csv latencies.csv handshake.csv
R CMD BATCH stats.r
dirs:
mkdir -p stat_results
clean:
- rm -f counts.csv
+ rm -f counts.csv latencies.csv handshake.csv
rm -f *.Rout
rm -f stat_results/*.pdf
counts.csv:
- echo "type, clients, handshakes, connection_timeouts, messages_sent, messages_recv, crashes" > counts.csv
+ echo "framework, 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
+latencies.csv:
+ echo "framework, timestamp, elapsed" > latencies.csv
+ for k in ../data/*/message_latencies.csv; do sed -e '1d' "$$k" >> latencies.csv; done
+
+handshake.csv:
+ echo "framework, timestamp, elapsed" > handshake.csv
+ for k in ../data/*/handshake_times.csv; do sed -e '1d' "$$k" >> handshake.csv; done
View
111 stats/stats.r
@@ -1,6 +1,13 @@
# R-script for producing statistics output:
-# Before runnning this script, makes sure you have the right packages installed:
-# install.packages("ggplot2")
+
+# Load all the necessary packages, installing missing ones when necessary
+packages.to.install <- c("plyr", "ggplot2")
+
+for(p in packages.to.install) {
+ print(p)
+ if (suppressWarnings(!require(p, character.only = TRUE))) install.packages(p, repos = "http://lib.stat.cmu.edu/R/CRAN")
+ if (p == "ggplot2") suppressWarnings(library(ggplot2))
+}
# Make sure needed libraries are there
require(ggplot2)
@@ -10,18 +17,96 @@ base_size <- 9
# Read in data
counts <- read.csv("counts.csv", header=TRUE)
+handshake <- read.csv("handshake.csv", header=TRUE)
+handshake <- transform(handshake, elapsed_ms = elapsed / 1000)
+
+#latencies <- read.csv("latencies.csv", header=TRUE)
+
+# A plot of the connection timeouts as a function
+ws.plot.conn_timeout <- function() {
+ conn_timeouts <- ggplot(counts, aes(x = framework, 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")))
+}
+
+# Jitter plot of the handshake times
+ws.plot.jitter <- function(T) {
+ box <- ggplot(T, aes(factor(framework), elapsed_ms))
+ (box + geom_jitter(alpha = 0.08) + coord_trans(y = "log10")
+ + xlab('Framework')
+ + ylab('Handshake Time (ms)')
+ + opts(axis.ticks = theme_blank(),
+ axis.text.x = theme_text(size = base_size * 0.8,
+ angle = 330,
+ hjust = 0,
+ colour = "grey50")))
+}
-# First plot, connection timeouts
+ws.plot.box <- function(T) {
+ box <- ggplot(T, aes(x = factor(framework), y = elapsed_ms))
+ (box + geom_boxplot() + coord_trans(y = "log10")
+ + xlab('Framework')
+ + ylab('Handshake Time (ms)')
+ + opts(axis.text.x = theme_text(size = base_size * 0.8,
+ angle = 330,
+ hjust = 0,
+ colour = "grey50")))
+}
+
+# Volcano
+ws.plot.volcano <- function(T) {
+ v <- ggplot(T, aes(x = log10(elapsed_ms)))
+ (v + stat_density(aes(ymax = ..density.., ymin = -..density..),
+ fill = "grey50",
+ colour = "grey50",
+ geom = "ribbon",
+ position = "identity")
+ + facet_grid(. ~ framework)
+ + coord_flip())
+}
+
+## BEGIN PLOTTING
+# Conn timeout
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")))
+ws.plot.conn_timeout()
dev.off()
+png("stat_results/conn_timeouts.png")
+ws.plot.conn_timeout()
+dev.off()
+
+# Handshake Jitter
+pdf("stat_results/handshake_jitter.pdf")
+ws.plot.jitter(handshake)
+dev.off()
+png("stat_results/handshake_jitter.png")
+ws.plot.jitter(handshake)
+dev.off()
+
+# Handshake Volcano
+pdf("stat_results/handshake_volcano.pdf", width=15)
+ws.plot.volcano(handshake)
+dev.off()
+
+# Handshake Box
+pdf("stat_results/handshake_box.pdf")
+ws.plot.box(handshake)
+dev.off()
+png("stat_results/handshake_box.png")
+ws.plot.box(handshake)
+dev.off()
+
+# Latencies Box
+# pdf("stat_results/latencies_box.pdf")
+# ws.plot.box(latencies)
+# dev.off()
+# png("stat_results/latencies_box.png")
+# ws.plot.box(latencies)
+# dev.off()
Something went wrong with that request. Please try again.