Ticket #22236: dirbytes-fraction.R

File dirbytes-fraction.R, 671 bytes (added by karsten, 2 years ago)
Line 
1require(ggplot2)
2require(reshape)
3require(scales)
4theme_update(plot.title = element_text(hjust = 0.5))
5
6b1 <- read.csv("bandwidth.csv", stringsAsFactors = FALSE)
7b1 <- b1[b1$isexit == "" & b1$isguard == "", ]
8b1 <- data.frame(date = as.Date(b1$date), variable = "bandwidth history",
9    value = (b1$dirread + b1$dirwrite) / (b1$bwread + b1$bwwrite))
10ggplot(b1, aes(x = as.Date(date), y = value)) +
11geom_line() +
12scale_x_date(name = "") +
13scale_y_continuous(name = "", labels = percent) +
14expand_limits(y = 0) +
15ggtitle("Directory traffic as a percentage of bandwidth history and advertised bandwidth\n")
16ggsave("dirbytes-fraction.png", width = 8, height = 5, dpi = 100)
17