@@ -57,24 +57,27 @@ for (currentdir in resultdirs) {
57
57
testname = datasetname
58
58
59
59
cdata = data.frame (boot_time = as.numeric(fdata $ BootResults $ launch_time $ Result )/ 1000 )
60
+ cdata = cbind(cdata , num_pods = as.numeric(fdata $ BootResults $ n_pods $ Result ))
60
61
61
62
# format the utilization data
62
63
udata = data.frame (nodename = fdata $ BootResults $ node_util )
63
64
for (i in seq(length(cdata [, " boot_time" ]))) {
65
+ num_pods = fdata $ BootResults $ n_pods $ Result [i ]
66
+ index = i - 1
64
67
if (i == 1 ) {
65
68
# first iteration provide column name for c1
66
69
c1 = cbind(node = udata $ nodename.node )
67
- c2 = cbind(udata $ nodename.noschedule )
68
- c3 = cbind(udata $ nodename.cpu_idle $ Result )
69
- c4 = cbind(udata $ nodename.mem_free $ Result )/ (1024 * 1024 )
70
- c5 = cbind(rep(i , length(udata $ nodename.node )))
71
- c6 = cbind(rep(testname , length(udata $ nodename.node )))
70
+ c2 = cbind(noschedule = udata $ nodename.noschedule )
71
+ c3 = cbind(cpu_idle = udata $ nodename.cpu_idle $ Result )
72
+ c4 = cbind(mem_free = udata $ nodename.mem_free $ Result )/ (1024 * 1024 )
73
+ # using index to make chart start with 0 rather than 1
74
+ c5 = cbind(pod = rep(num_pods , length(udata $ nodename.node )))
75
+ c6 = cbind(testname = rep(testname , length(udata $ nodename.node )))
72
76
# declare formatted utility data
73
77
fudata = cbind(c1 ,c2 ,c3 ,c4 ,c5 ,c6 )
74
78
}
75
79
else {
76
80
# shift to 0 based indexing
77
- index = i - 1
78
81
sindex = (index * 4 )+ 1
79
82
eindex = sindex + 3
80
83
# grab 3 columns for next row bind
@@ -83,14 +86,14 @@ for (currentdir in resultdirs) {
83
86
c2 = cbind(row [,2 ])
84
87
c3 = cbind(row [,3 ]$ Result )
85
88
c4 = cbind(row [,4 ]$ Result )/ (1024 * 1024 )
86
- c5 = cbind(rep(i , length(udata $ nodename.node )))
89
+ # using index to make chart start with 0 rather than 1
90
+ c5 = cbind(rep(num_pods , length(udata $ nodename.node )))
87
91
c6 = cbind(rep(testname , length(udata $ nodename.node )))
88
92
# create the new row (which is actually the number of nodes of rows)
89
93
frow = cbind(c1 ,c2 ,c3 ,c4 ,c5 ,c6 )
90
94
fudata = rbind(fudata ,frow )
91
95
}
92
96
}
93
- colnames(fudata )= c(" node" , " noschedule" , " cpu_idle" , " mem_free" , " pod" , " testname" )
94
97
# fudata is considered a vector for some reason so converting it to a data.frame
95
98
fudata = as.data.frame(fudata )
96
99
# get unique node names
@@ -113,44 +116,43 @@ for (currentdir in resultdirs) {
113
116
114
117
# format the pod data from 2 nested columns in a series
115
118
# of index specific columns to just 2 columns
116
- pdata = data.frame (fdata $ BootResults $ launched_pods )
119
+ # omitting the first row as it is the baseline and contains
120
+ # NA values for launched pods as there were none. If we don't
121
+ # omit the first row, this will throw a warning, but notice that it
122
+ # makes the index funky below
123
+ pdata = data.frame (fdata $ BootResults $ launched_pods [- 1 ])
117
124
pudata = c()
118
- for (i in seq(length(cdata [, " boot_time" ]))) {
119
- if (i == 1 ) {
120
- # there are no valid values for this index, skipping
121
- next
122
- }
123
- else {
124
- # shift to 0 based indexing
125
- index = i - 1
126
- sindex = (index * 2 )+ 1
127
- eindex = sindex + 1
128
- row = cbind(pdata [,sindex : eindex ])
129
- c1 = cbind(podname = row [,1 ])
130
- c2 = cbind(node = row [,2 ])
131
- c3 = cbind(count = rep(i , length(pdata $ pod_name )))
132
- c4 = cbind(boot_time = rep(cdata [, " boot_time" ][i ],length(pdata $ pod_name )))
133
- c5 = cbind(dataset = rep(testname , length(pdata $ pod_name )))
134
- prow = cbind(c1 ,c2 ,c3 ,c4 ,c5 )
135
- pudata = rbind(pudata ,prow )
136
- }
125
+ # pdata is 1 row shorter than cdata, hence the subtract 1
126
+ for (i in seq(length(cdata [, " boot_time" ]) - 1 )) {
127
+ # using i+1 rather than i to account for the missing row when indexing in to fdata
128
+ num_pods = fdata $ BootResults $ n_pods $ Result [i + 1 ]
129
+ # shift to 0 based indexing for pdata, so we can iterate through the generated named columns
130
+ index = i - 1
131
+ sindex = (index * 2 )+ 1
132
+ eindex = sindex + 1
133
+ row = cbind(pdata [,sindex : eindex ])
134
+ c1 = cbind(podname = row [,1 ])
135
+ c2 = cbind(node = row [,2 ])
136
+ c3 = cbind(count = rep(num_pods , length(pdata $ pod_name )))
137
+ # using i+1 rather than i to account for the missing row when indexing in to cdata
138
+ c4 = cbind(boot_time = rep(cdata [, " boot_time" ][i + 1 ],length(pdata $ pod_name )))
139
+ c5 = cbind(dataset = rep(testname , length(pdata $ pod_name )))
140
+ prow = cbind(c1 ,c2 ,c3 ,c4 ,c5 )
141
+ pudata = rbind(pudata ,prow )
137
142
}
138
143
# pndata is considered a vector for some reason so converting it to a data.frame
139
144
pudata = as.data.frame(pudata )
140
145
pudata $ count = as.numeric(as.character(pudata $ count ))
141
146
pudata $ boot_time = as.numeric(as.character(pudata $ boot_time ))
142
147
143
- cdata = cbind( cdata , count = seq_len(length( cdata [, " boot_time " ])))
148
+ # using 0 based index rather than starting with 1
144
149
cdata = cbind(cdata , testname = rep(testname , length(cdata [, " boot_time" ]) ))
145
150
cdata = cbind(cdata , dataset = rep(datasetname , length(cdata [, " boot_time" ]) ))
146
151
147
152
# Gather our statistics
148
153
# '-1' containers, as the first entry should be a data capture of before
149
154
# the first container was run.
150
- # FIXME - once the test starts to store a stats baseline in slot 0, then
151
- # we should re-enable the '-1'
152
- # sdata=data.frame(num_containers=length(cdata[, "avail_gb"])-1)
153
- sdata = data.frame (num_containers = length(cdata [, " boot_time" ]))
155
+ sdata = data.frame (num_pods = as.numeric(as.character(cdata [, " num_pods" ][length(cdata [, " num_pods" ])])))
154
156
sudata = c()
155
157
# first (which should be 0-containers)
156
158
for (nodename in nodes ) {
@@ -169,10 +171,13 @@ for (currentdir in resultdirs) {
169
171
as.numeric(as.character(cdata [, node_cpu_idle ][length(cdata [, node_cpu_idle ])])))
170
172
sudata = rbind(sudata , srdata )
171
173
}
174
+
175
+ # now that we have sudata, perform the calculations
176
+ total_pods = as.numeric(as.character(cdata [, " num_pods" ][length(cdata [, " num_pods" ])]))
172
177
sdata = cbind(sdata , mem_consumed = sum(sudata [, " mem_consumed" ]))
173
178
sdata = cbind(sdata , cpu_consumed = sum(sudata [, " cpu_consumed" ]))
174
179
sdata = cbind(sdata , boot_time = cdata [, " boot_time" ][length(cdata [, " boot_time" ])])
175
- sdata = cbind(sdata , avg_gb_per_c = sdata $ mem_consumed / sdata $ num_containers )
180
+ sdata = cbind(sdata , avg_gb_per_c = sdata $ mem_consumed / total_pods )
176
181
sdata = cbind(sdata , runtime = testname )
177
182
178
183
# Store away as a single set
@@ -183,17 +188,17 @@ for (currentdir in resultdirs) {
183
188
184
189
ms = c(
185
190
" Test" = testname ,
186
- " n" = sdata $ num_containers ,
191
+ " n" = total_pods ,
187
192
" size" = round((sdata $ mem_consumed ), 3 ),
188
193
" gb/n" = round(sdata $ avg_gb_per_c , digits = 4 ),
189
194
" n/Gb" = round(1 / sdata $ avg_gb_per_c , digits = 2 )
190
195
)
191
196
192
197
cs = c(
193
198
" Test" = testname ,
194
- " n" = sdata $ num_containers ,
199
+ " n" = total_pods ,
195
200
" cpu" = round(sdata $ cpu_consumed , digits = 3 ),
196
- " cpu/n" = round((sdata $ cpu_consumed / sdata $ num_containers ), digits = 4 )
201
+ " cpu/n" = round((sdata $ cpu_consumed / num_pods ), digits = 4 )
197
202
)
198
203
199
204
rstats = rbind(rstats , ms )
@@ -223,7 +228,7 @@ mem_stats_plot = suppressWarnings(ggtexttable(data.frame(rstats),
223
228
mem_line_plot <- ggplot(data = fndata , aes(as.numeric(as.character(pod )),
224
229
as.numeric(as.character(mem_free )),
225
230
colour = (if (num_test_runs > 1 ) testname else node ),
226
- group = interaction(testname , node ))) +
231
+ group = interaction(testname , node ))) +
227
232
labs(colour = colour_label ) +
228
233
geom_line(alpha = 0.2 ) +
229
234
geom_point(aes(shape = node ), alpha = 0.3 , size = 0.5 ) +
@@ -240,7 +245,7 @@ cpu_stats_plot = suppressWarnings(ggtexttable(data.frame(cstats), theme=ttheme(b
240
245
cpu_line_plot <- ggplot(data = fndata , aes(as.numeric(as.character(pod )),
241
246
as.numeric(as.character(cpu_idle )),
242
247
colour = (if (num_test_runs > 1 ) testname else node ),
243
- group = interaction(testname , node ))) +
248
+ group = interaction(testname , node ))) +
244
249
labs(colour = colour_label ) +
245
250
geom_line(alpha = 0.2 ) +
246
251
geom_point(aes(shape = node ), alpha = 0.3 , size = 0.5 ) +
@@ -252,7 +257,7 @@ cpu_line_plot <- ggplot(data=fndata, aes(as.numeric(as.character(pod)),
252
257
253
258
# Show how boot time changed
254
259
boot_line_plot <- ggplot() +
255
- geom_line( data = data , aes(count , boot_time , colour = testname , group = dataset ), alpha = 0.2 ) +
260
+ geom_line( data = data , aes(num_pods , boot_time , colour = testname , group = dataset ), alpha = 0.2 ) +
256
261
geom_point( data = pndata , aes(count , boot_time , colour = interaction(dataset , node ), group = dataset ), alpha = 0.6 , size = 0.6 , stroke = 0 , shape = 16 ) +
257
262
xlab(" pods" ) +
258
263
ylab(" Boot time (s)" ) +
0 commit comments