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>
This commit is contained in:
Alex
2022-01-20 19:44:55 -07:00
committed by GitHub
parent 3ba7b34b25
commit a926082e4d
3 changed files with 196 additions and 154 deletions

View File

@@ -1232,7 +1232,7 @@ export const createTenantCommon: any = {
paddingTop: 15,
},
descriptionText: {
fontSize: 16,
fontSize: 14,
},
};

View File

@@ -166,7 +166,7 @@ const styles = (theme: Theme) =>
const STResults = ({ classes, results, start, autotune }: ISTResults) => {
const [jsonView, setJsonView] = useState<boolean>(false);
const finalRes = results[results.length - 1];
const finalRes = results[results.length - 1] || [];
const getServers: STServer[] = get(finalRes, "GETStats.servers", []) || [];
const putServers: STServer[] = get(finalRes, "PUTStats.servers", []) || [];
@@ -188,14 +188,22 @@ const STResults = ({ classes, results, start, autotune }: ISTResults) => {
}) => {
const avg = calculateBytes(throughput);
let total = "--";
let unit = "";
if (avg.total !== 0) {
total = avg.total.toString();
unit = `${avg.unit}/S`;
}
return (
<Grid container>
<Grid item xs={12} className={classes.objectGeneralTitle}>
{title}
</Grid>
<Grid item xs={12} md={6} className={classes.metricValContainer}>
<span className={classes.testUnitRes}>{avg.total}</span>
<span className={classes.generalUnit}>{avg.unit}/S</span>
<span className={classes.testUnitRes}>{total}</span>
<span className={classes.generalUnit}>{unit}</span>
</Grid>
</Grid>
);
@@ -270,16 +278,6 @@ const STResults = ({ classes, results, start, autotune }: ISTResults) => {
const clnMetrics = cleanMetrics(results);
return (
<Fragment>
{clnMetrics.length <= 1 && (
<Grid container>
<Grid item xs={12} className={classes.initialResults}>
Please wait while we get {autotune ? "the initial" : "the system"}{" "}
results...
</Grid>
</Grid>
)}
{clnMetrics.length > 1 && (
<Fragment>
<Grid container className={classes.objectGeneral}>
<Grid item xs={12} md={6} lg={4}>
@@ -351,6 +349,8 @@ const STResults = ({ classes, results, start, autotune }: ISTResults) => {
</Grid>
</Grid>
<br />
{clnMetrics.length > 1 && (
<Fragment>
<Grid container>
<Grid item xs={12} md={6} className={classes.descriptorLabel}>
{start ? (

View File

@@ -28,6 +28,7 @@ import {
actionsTray,
advancedFilterToggleStyles,
containerForHeader,
formFieldStyles,
searchField,
} from "../Common/FormComponents/common/styleLibrary";
import { wsProtocol } from "../../../utils/wsUtils";
@@ -79,9 +80,13 @@ const styles = (theme: Theme) =>
advancedOption: {
marginTop: 20,
},
advancedAutotune: {
marginTop: 10,
},
...advancedFilterToggleStyles,
...actionsTray,
...searchField,
...formFieldStyles,
...containerForHeader(theme.spacing(4)),
});
@@ -280,6 +285,48 @@ const Speedtest = ({ classes, distributedSetup }: ISpeedtest) => {
}`}
>
<Grid item xs={12}>
<Grid
container
direction="row"
justifyContent="space-around"
alignItems="center"
>
<Grid
item
xs={12}
md={4}
className={classes.advancedOption}
>
<InputBoxWrapper
id={"size"}
name={"size"}
label={"Object Size"}
onChange={(e) => {
setSize(e.target.value);
}}
value={size}
disabled={start}
overlayObject={
<InputUnitMenu
id={"size-unit"}
onUnitChange={setSizeUnit}
unitSelected={sizeUnit}
unitsList={[
{ label: "KB", value: "KB" },
{ label: "MB", value: "MB" },
{ label: "GB", value: "GB" },
]}
disabled={start}
/>
}
/>
</Grid>
<Grid
item
xs={12}
md={4}
className={classes.advancedAutotune}
>
<CheckboxWrapper
checked={autotune}
onChange={(e) => setAutotune(e.target.checked)}
@@ -287,14 +334,27 @@ const Speedtest = ({ classes, distributedSetup }: ISpeedtest) => {
name={"autotune"}
label={"Enable Autotune"}
tooltip={
"Autotune gets the maximum stats for the system by running with multiple configurations at once. \
This configuration is enabled by default and disables the rest of available options"
"Autotune gets the maximum stats for the system by testing multiple configurations at once. This configuration is enabled by default and overrides duration & concurrent requests options"
}
value="true"
disabled={start}
/>
</Grid>
<Grid item xs={12} md={3} className={classes.advancedOption}>
</Grid>
</Grid>
<Grid item xs={12}>
<Grid
container
direction="row"
justifyContent="space-around"
alignItems="center"
>
<Grid
item
xs={12}
md={4}
className={classes.advancedOption}
>
<InputBoxWrapper
id={"duration"}
name={"duration"}
@@ -318,32 +378,12 @@ const Speedtest = ({ classes, distributedSetup }: ISpeedtest) => {
}
/>
</Grid>
<Grid item xs={12} md={3} className={classes.advancedOption}>
<InputBoxWrapper
id={"size"}
name={"size"}
label={"Object Size"}
onChange={(e) => {
setSize(e.target.value);
}}
value={size}
disabled={start || autotune}
overlayObject={
<InputUnitMenu
id={"size-unit"}
onUnitChange={setSizeUnit}
unitSelected={sizeUnit}
unitsList={[
{ label: "KB", value: "KB" },
{ label: "MB", value: "MB" },
{ label: "GB", value: "GB" },
]}
disabled={start || autotune}
/>
}
/>
</Grid>
<Grid item xs={12} md={3} className={classes.advancedOption}>
<Grid
item
xs={12}
md={4}
className={classes.advancedOption}
>
<InputBoxWrapper
type="number"
min="0"
@@ -358,6 +398,8 @@ const Speedtest = ({ classes, distributedSetup }: ISpeedtest) => {
/>
</Grid>
</Grid>
</Grid>
</Grid>
<Grid container className={classes.multiModule}>
<Grid item xs={12}>
<Fragment>