library("dplyr")
library("ggplot2")

plot_defaults <- theme_bw()

df <- read.csv("procs_per_core.csv")

df$cores <- sapply(as.character(df$ami_type), function(type) {
  switch(type,
    m1.small = 2, m1.medium = 1, m1.large = 2, m1.xlarge = 4, m2.xlarge = 2,
    m2.2xlarge = 4, m3.medium = 1, m3.large = 2, m3.xlarge = 4, c1.medium = 2,
    c1.xlarge = 8, c3.large = 2, c3.xlarge = 4, c3.2xlarge = 8, c3.4xlarge = 16
    )
})
df %>% 
  ggplot(aes(procs/cores)) +
  geom_histogram(binwidth = 1) +
  scale_x_continuous(breaks=seq(0, max(df$procs/df$cores), by=2)) +
  xlab("Procs per core") +
  plot_defaults

plot of chunk unnamed-chunk-2

df %>% 
  ggplot(aes(procs/cores)) +
  geom_histogram(binwidth = 1) +
  scale_x_continuous(breaks=seq(0, max(df$procs/df$cores), by=2)) +
  facet_wrap(~ami_type, ncol = 1) +
  xlab("Procs per core") +
  plot_defaults

plot of chunk unnamed-chunk-3