Skip to content

Commit a926082

Browse files
bexsoftBenjamin Perez
andauthored
Updated speedtest behavior (#1427)
- Allowed object size changed in autotune mode - Removed "Please wait while we get x results... " - Reorganized advanced options form Signed-off-by: Benjamin Perez <benjamin@bexsoft.net> Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent 3ba7b34 commit a926082

File tree

3 files changed

+194
-152
lines changed

3 files changed

+194
-152
lines changed

portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ export const createTenantCommon: any = {
12321232
paddingTop: 15,
12331233
},
12341234
descriptionText: {
1235-
fontSize: 16,
1235+
fontSize: 14,
12361236
},
12371237
};
12381238

portal-ui/src/screens/Console/Speedtest/STResults.tsx

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ const styles = (theme: Theme) =>
166166
const STResults = ({ classes, results, start, autotune }: ISTResults) => {
167167
const [jsonView, setJsonView] = useState<boolean>(false);
168168

169-
const finalRes = results[results.length - 1];
169+
const finalRes = results[results.length - 1] || [];
170170

171171
const getServers: STServer[] = get(finalRes, "GETStats.servers", []) || [];
172172
const putServers: STServer[] = get(finalRes, "PUTStats.servers", []) || [];
@@ -188,14 +188,22 @@ const STResults = ({ classes, results, start, autotune }: ISTResults) => {
188188
}) => {
189189
const avg = calculateBytes(throughput);
190190

191+
let total = "--";
192+
let unit = "";
193+
194+
if (avg.total !== 0) {
195+
total = avg.total.toString();
196+
unit = `${avg.unit}/S`;
197+
}
198+
191199
return (
192200
<Grid container>
193201
<Grid item xs={12} className={classes.objectGeneralTitle}>
194202
{title}
195203
</Grid>
196204
<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>
199207
</Grid>
200208
</Grid>
201209
);
@@ -271,86 +279,78 @@ const STResults = ({ classes, results, start, autotune }: ISTResults) => {
271279

272280
return (
273281
<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+
&nbsp; GET
289+
</div>
290+
}
291+
throughput={getThroughput}
292+
objects={getObjects}
293+
/>
280294
</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-
&nbsp; 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-
&nbsp; 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+
&nbsp; 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>
322320

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+
/>
330328

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>
354354
<Grid container>
355355
<Grid item xs={12} md={6} className={classes.descriptorLabel}>
356356
{start ? (

0 commit comments

Comments
 (0)