-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex10.R
30 lines (26 loc) · 1.36 KB
/
ex10.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
library(ggplot2)
library(plyr)
library(reshape2)
library(grid)
library(gridExtra)
sysbench_oltp<-read.table("r_ggplot2_benchmark_visualization/sysbench_simple.txt",sep=",",as.is=T,header=F)
colnames(sysbench_oltp)<-c("time","storage","ro_rw","threads","metric","value")
# sysbench_throughput
sysbench_tps<-subset(sysbench_oltp,metric=="sysbench_tps" & threads=="256" & ro_rw=="rw" & storage=='eXFlash DIMM_8')
sysbench_tps$value<-as.numeric(sysbench_tps$value)
sysbench_tps_summ<-ddply(sysbench_tps,c("storage","threads","ro_rw"),
summarize,sd_throughput=sd(value),
mean_throughput=mean(value),
t95th_percentile_throughput=quantile(value, 0.95),
max_throughput=max(value))
tps_graph<-ggplot(sysbench_tps)
tps_graph<-tps_graph+aes(x=time,y=value,geom=storage,colour=storage)
tps_graph<-tps_graph+geom_jitter(alpha=0.3)
tps_graph<-tps_graph+expand_limits(y=0)
tps_graph<-tps_graph+theme(legend.position="bottom")
tps_graph<-tps_graph+xlab("Time (sec)")
tps_graph<-tps_graph+ylab("Transactions per second")
tps_graph<-tps_graph+guides(colour=guide_legend(override.aes=list(alpha=1, fill=NA)))
tps_graph<-tps_graph+scale_color_hue(l=55,name="storage")
tps_graph
ggsave(plot = tps_graph, "r_ggplot2_benchmark_visualization/ex10.png", dpi=200, scale=1, height=6, width=6, type = "cairo-png")