Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
yufansong committed Feb 23, 2024
1 parent 5ab8509 commit 8d96ac2
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions dashboard/pages/fragment_graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<BackPressuresMetrics>()
Expand Down Expand Up @@ -480,7 +468,7 @@ export default function Streaming() {
))}
</Select>
</FormControl>
{backPressureAlgoOptions.length > 0 && (
{backPressureDataSourceAlgo === "Prometheus" && (
<FormControl>
<FormLabel>Back Pressure Algorithm</FormLabel>
<Select
Expand All @@ -492,7 +480,7 @@ export default function Streaming() {
<option value="" disabled selected hidden>
Please select
</option>
{backPressureAlgoOptions.map((algo) => (
{backPressureAlgos.map((algo) => (
<option value={algo} key={algo}>
{algo}
</option>
Expand Down

0 comments on commit 8d96ac2

Please sign in to comment.