From 8d96ac201785baf13519983548ffe686a2ececa5 Mon Sep 17 00:00:00 2001 From: yufansong Date: Thu, 22 Feb 2024 23:19:16 -0800 Subject: [PATCH] refactor --- dashboard/pages/fragment_graph.tsx | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/dashboard/pages/fragment_graph.tsx b/dashboard/pages/fragment_graph.tsx index bcc7f8cf725f6..8d1330cd69828 100644 --- a/dashboard/pages/fragment_graph.tsx +++ b/dashboard/pages/fragment_graph.tsx @@ -198,10 +198,6 @@ export default function Streaming() { // used to get the data source const [backPressureDataSourceAlgo, setBackPressureDataSourceAlgo] = useState("Embedded") - // used to set the back pressure choice list - const [backPressureAlgoOptions, setBackPressureAlgoOptions] = useState( - [] as BackPressureAlgo[] - ) const { response: actorBackPressures } = useFetch( getActorBackPressures, @@ -237,14 +233,6 @@ export default function Streaming() { return () => {} }, [relationId, relationList, setRelationId]) - useEffect(() => { - if (backPressureDataSourceAlgo === "Prometheus") { - setBackPressureAlgoOptions(backPressureAlgos) - } else { - setBackPressureAlgoOptions([]) - } - }, [backPressureDataSourceAlgo]) - // get back pressure rate without prometheus const [backPressuresMetricsWithoutPromtheus, setBackPressuresMetrics] = useState() @@ -480,7 +468,7 @@ export default function Streaming() { ))} - {backPressureAlgoOptions.length > 0 && ( + {backPressureDataSourceAlgo === "Prometheus" && ( Back Pressure Algorithm