Skip to content

Instantly share code, notes, and snippets.

@tatsuya6502
Created July 6, 2011 00:51
Show Gist options
  • Save tatsuya6502/1066305 to your computer and use it in GitHub Desktop.
Save tatsuya6502/1066305 to your computer and use it in GitHub Desktop.
R scripts to plot inode counts from HibariFS
#!/usr/bin/Rscript --vanilla
require(ggplot2)
inodeCount1 <- read.csv(sprintf("%s/%s", ".", "stats_3.csv"))
inodeCount2 <- read.csv(sprintf("%s/%s", ".", "stats_2.csv"))
summary1 <- read.csv(sprintf("%s/%s", ".", "summary_3.csv"))
summary2 <- read.csv(sprintf("%s/%s", ".", "summary_2.csv"))
data1 <- list(inodeCount = inodeCount1, summary = summary1)
data2 <- list(inodeCount = inodeCount2, summary = summary2)
data1$inodeCount$tag <- "vfs_cache_pressure = 100 (default)"
data2$inodeCount$tag <- "vfs_cache_pressure = 10000"
data1$summary$tag <- "vfs_cache_pressure = 100 (default)"
data2$summary$tag <- "vfs_cache_pressure = 10000"
png(file = "inodes.png", width=1024, height=768)
plot1 <- qplot(elapsed, cached.inodes,
data = data1$inodeCount,
color = tag,
geom = "smooth",
xlab = "Elapsed Secs",
ylab = "Inode Count",
main = "Cached Inodes") + geom_smooth(data = data2$inodeCount)
plot2 <- qplot(elapsed, total / window,
data = data1$summary,
color = tag,
geom = "smooth",
xlab = "Elapsed Secs",
ylab = "Req/Sec",
main = "Throughput") + geom_smooth(data = data2$summary)
grid.newpage()
pushViewport(viewport(layout = grid.layout(2, 1)))
vplayout <- function(x,y) viewport(layout.pos.row = x, layout.pos.col = y)
print(plot1, vp = vplayout(1,1))
print(plot2, vp = vplayout(2,1))
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment