From a926082e4d8a230b67b6249d16f0d46fb574fbe5 Mon Sep 17 00:00:00 2001 From: Alex <33497058+bexsoft@users.noreply.github.com> Date: Thu, 20 Jan 2022 19:44:55 -0700 Subject: [PATCH] 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 Co-authored-by: Benjamin Perez --- .../FormComponents/common/styleLibrary.ts | 2 +- .../screens/Console/Speedtest/STResults.tsx | 160 +++++++-------- .../screens/Console/Speedtest/Speedtest.tsx | 188 +++++++++++------- 3 files changed, 196 insertions(+), 154 deletions(-) diff --git a/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts b/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts index c291c5859..63fffc53a 100644 --- a/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts +++ b/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts @@ -1232,7 +1232,7 @@ export const createTenantCommon: any = { paddingTop: 15, }, descriptionText: { - fontSize: 16, + fontSize: 14, }, }; diff --git a/portal-ui/src/screens/Console/Speedtest/STResults.tsx b/portal-ui/src/screens/Console/Speedtest/STResults.tsx index 216db519a..1c9664a48 100644 --- a/portal-ui/src/screens/Console/Speedtest/STResults.tsx +++ b/portal-ui/src/screens/Console/Speedtest/STResults.tsx @@ -166,7 +166,7 @@ const styles = (theme: Theme) => const STResults = ({ classes, results, start, autotune }: ISTResults) => { const [jsonView, setJsonView] = useState(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 ( {title} - {avg.total} - {avg.unit}/S + {total} + {unit} ); @@ -271,86 +279,78 @@ const STResults = ({ classes, results, start, autotune }: ISTResults) => { return ( - {clnMetrics.length <= 1 && ( - - - Please wait while we get {autotune ? "the initial" : "the system"}{" "} - results... - + + + + +   GET + + } + throughput={getThroughput} + objects={getObjects} + /> - )} + + + +   PUT + + } + throughput={putThroughput} + objects={putObjects} + /> + + + + + + + + + + + + + + + + + + + + + + + +
{clnMetrics.length > 1 && ( - - - - -   GET - - } - throughput={getThroughput} - objects={getObjects} - /> - - - - -   PUT - - } - throughput={putThroughput} - objects={putObjects} - /> - - - - - - - - - - - - - - - - - - - - - - - -
{start ? ( diff --git a/portal-ui/src/screens/Console/Speedtest/Speedtest.tsx b/portal-ui/src/screens/Console/Speedtest/Speedtest.tsx index ac3f09a0e..9a840738c 100644 --- a/portal-ui/src/screens/Console/Speedtest/Speedtest.tsx +++ b/portal-ui/src/screens/Console/Speedtest/Speedtest.tsx @@ -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,82 +285,119 @@ const Speedtest = ({ classes, distributedSetup }: ISpeedtest) => { }`} > - setAutotune(e.target.checked)} - id={"autotune"} - 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" - } - value="true" - disabled={start} - /> + + + { + setSize(e.target.value); + }} + value={size} + disabled={start} + overlayObject={ + + } + /> + + + setAutotune(e.target.checked)} + id={"autotune"} + name={"autotune"} + label={"Enable Autotune"} + tooltip={ + "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} + /> + + - - { - setDuration(e.target.value); - }} - value={duration} - disabled={start || autotune} - overlayObject={ - + + + { + setDuration(e.target.value); + }} + value={duration} + disabled={start || autotune} + overlayObject={ + + } + /> + + + { + setConcurrent(e.target.value); + }} + value={concurrent} disabled={start || autotune} /> - } - /> - - - { - setSize(e.target.value); - }} - value={size} - disabled={start || autotune} - overlayObject={ - - } - /> - - - { - setConcurrent(e.target.value); - }} - value={concurrent} - disabled={start || autotune} - /> + +