@@ -166,7 +166,7 @@ const styles = (theme: Theme) =>
166
166
const STResults = ( { classes, results, start, autotune } : ISTResults ) => {
167
167
const [ jsonView , setJsonView ] = useState < boolean > ( false ) ;
168
168
169
- const finalRes = results [ results . length - 1 ] ;
169
+ const finalRes = results [ results . length - 1 ] || [ ] ;
170
170
171
171
const getServers : STServer [ ] = get ( finalRes , "GETStats.servers" , [ ] ) || [ ] ;
172
172
const putServers : STServer [ ] = get ( finalRes , "PUTStats.servers" , [ ] ) || [ ] ;
@@ -188,14 +188,22 @@ const STResults = ({ classes, results, start, autotune }: ISTResults) => {
188
188
} ) => {
189
189
const avg = calculateBytes ( throughput ) ;
190
190
191
+ let total = "--" ;
192
+ let unit = "" ;
193
+
194
+ if ( avg . total !== 0 ) {
195
+ total = avg . total . toString ( ) ;
196
+ unit = `${ avg . unit } /S` ;
197
+ }
198
+
191
199
return (
192
200
< Grid container >
193
201
< Grid item xs = { 12 } className = { classes . objectGeneralTitle } >
194
202
{ title }
195
203
</ Grid >
196
204
< Grid item xs = { 12 } md = { 6 } className = { classes . metricValContainer } >
197
- < span className = { classes . testUnitRes } > { avg . total } </ span >
198
- < span className = { classes . generalUnit } > { avg . unit } /S </ span >
205
+ < span className = { classes . testUnitRes } > { total } </ span >
206
+ < span className = { classes . generalUnit } > { unit } </ span >
199
207
</ Grid >
200
208
</ Grid >
201
209
) ;
@@ -271,86 +279,78 @@ const STResults = ({ classes, results, start, autotune }: ISTResults) => {
271
279
272
280
return (
273
281
< Fragment >
274
- { clnMetrics . length <= 1 && (
275
- < Grid container >
276
- < Grid item xs = { 12 } className = { classes . initialResults } >
277
- Please wait while we get { autotune ? "the initial" : "the system" } { " " }
278
- results...
279
- </ Grid >
282
+ < Grid container className = { classes . objectGeneral } >
283
+ < Grid item xs = { 12 } md = { 6 } lg = { 4 } >
284
+ < ObjectGeneral
285
+ title = {
286
+ < div className = { classes . download } >
287
+ < DownloadStatIcon />
288
+ GET
289
+ </ div >
290
+ }
291
+ throughput = { getThroughput }
292
+ objects = { getObjects }
293
+ />
280
294
</ Grid >
281
- ) }
282
- { clnMetrics . length > 1 && (
283
- < Fragment >
284
- < Grid container className = { classes . objectGeneral } >
285
- < Grid item xs = { 12 } md = { 6 } lg = { 4 } >
286
- < ObjectGeneral
287
- title = {
288
- < div className = { classes . download } >
289
- < DownloadStatIcon />
290
- GET
291
- </ div >
292
- }
293
- throughput = { getThroughput }
294
- objects = { getObjects }
295
- />
296
- </ Grid >
297
- < Grid item xs = { 12 } md = { 6 } lg = { 4 } >
298
- < ObjectGeneral
299
- title = {
300
- < div className = { classes . upload } >
301
- < UploadStatIcon />
302
- PUT
303
- </ div >
304
- }
305
- throughput = { putThroughput }
306
- objects = { putObjects }
307
- />
308
- </ Grid >
309
- < Grid item xs = { 12 } md = { 12 } lg = { 4 } >
310
- < ResponsiveContainer width = "99%" >
311
- < AreaChart data = { clnMetrics } >
312
- < defs >
313
- < linearGradient id = "colorPut" x1 = "0" y1 = "0" x2 = "0" y2 = "1" >
314
- < stop offset = "0%" stopColor = "#2781B0" stopOpacity = { 0.9 } />
315
- < stop offset = "95%" stopColor = "#fff" stopOpacity = { 0 } />
316
- </ linearGradient >
317
- < linearGradient id = "colorGet" x1 = "0" y1 = "0" x2 = "0" y2 = "1" >
318
- < stop offset = "0%" stopColor = "#4CCB92" stopOpacity = { 0.9 } />
319
- < stop offset = "95%" stopColor = "#fff" stopOpacity = { 0 } />
320
- </ linearGradient >
321
- </ defs >
295
+ < Grid item xs = { 12 } md = { 6 } lg = { 4 } >
296
+ < ObjectGeneral
297
+ title = {
298
+ < div className = { classes . upload } >
299
+ < UploadStatIcon />
300
+ PUT
301
+ </ div >
302
+ }
303
+ throughput = { putThroughput }
304
+ objects = { putObjects }
305
+ />
306
+ </ Grid >
307
+ < Grid item xs = { 12 } md = { 12 } lg = { 4 } >
308
+ < ResponsiveContainer width = "99%" >
309
+ < AreaChart data = { clnMetrics } >
310
+ < defs >
311
+ < linearGradient id = "colorPut" x1 = "0" y1 = "0" x2 = "0" y2 = "1" >
312
+ < stop offset = "0%" stopColor = "#2781B0" stopOpacity = { 0.9 } />
313
+ < stop offset = "95%" stopColor = "#fff" stopOpacity = { 0 } />
314
+ </ linearGradient >
315
+ < linearGradient id = "colorGet" x1 = "0" y1 = "0" x2 = "0" y2 = "1" >
316
+ < stop offset = "0%" stopColor = "#4CCB92" stopOpacity = { 0.9 } />
317
+ < stop offset = "95%" stopColor = "#fff" stopOpacity = { 0 } />
318
+ </ linearGradient >
319
+ </ defs >
322
320
323
- < CartesianGrid
324
- strokeDasharray = { "0 0" }
325
- strokeWidth = { 1 }
326
- strokeOpacity = { 0.5 }
327
- stroke = { "#F1F1F1" }
328
- vertical = { false }
329
- />
321
+ < CartesianGrid
322
+ strokeDasharray = { "0 0" }
323
+ strokeWidth = { 1 }
324
+ strokeOpacity = { 0.5 }
325
+ stroke = { "#F1F1F1" }
326
+ vertical = { false }
327
+ />
330
328
331
- < Area
332
- type = "monotone"
333
- dataKey = { "get" }
334
- stroke = { "#4CCB92" }
335
- fill = { "url(#colorGet)" }
336
- fillOpacity = { 0.3 }
337
- strokeWidth = { 2 }
338
- dot = { false }
339
- />
340
- < Area
341
- type = "monotone"
342
- dataKey = { "put" }
343
- stroke = { "#2781B0" }
344
- fill = { "url(#colorPut)" }
345
- fillOpacity = { 0.3 }
346
- strokeWidth = { 2 }
347
- dot = { false }
348
- />
349
- </ AreaChart >
350
- </ ResponsiveContainer >
351
- </ Grid >
352
- </ Grid >
353
- < br />
329
+ < Area
330
+ type = "monotone"
331
+ dataKey = { "get" }
332
+ stroke = { "#4CCB92" }
333
+ fill = { "url(#colorGet)" }
334
+ fillOpacity = { 0.3 }
335
+ strokeWidth = { 2 }
336
+ dot = { false }
337
+ />
338
+ < Area
339
+ type = "monotone"
340
+ dataKey = { "put" }
341
+ stroke = { "#2781B0" }
342
+ fill = { "url(#colorPut)" }
343
+ fillOpacity = { 0.3 }
344
+ strokeWidth = { 2 }
345
+ dot = { false }
346
+ />
347
+ </ AreaChart >
348
+ </ ResponsiveContainer >
349
+ </ Grid >
350
+ </ Grid >
351
+ < br />
352
+ { clnMetrics . length > 1 && (
353
+ < Fragment >
354
354
< Grid container >
355
355
< Grid item xs = { 12 } md = { 6 } className = { classes . descriptorLabel } >
356
356
{ start ? (
0 commit comments