unbridled-41 opened a new issue, #5917:
URL: https://github.com/apache/rocketmq-dashboard/issues/5917
### Studio Version
branch: `rocketmq-studio` @ `7e7aa344` (the revision verified; the branch is
based on it)
deployed as: not required to reproduce
### Runtime Environment
Reproduced with the frontend tests (`cd web && npx vitest run
src/pages/cluster/__tests__/ClusterPage.test.tsx`); the live case needs a
broker whose runtime-stats read fails.
### Connected RocketMQ Cluster
Any cluster with a broker whose runtime stats cannot be read (permissions,
unreachable admin endpoint, older agent) - the path the backend reports as
`status=warning` for the cluster.
### Describe the Bug
`BrokerVO` carries `diskUsage`/`tpsIn`/`tpsOut` as primitive zeros plus
`runtimeStatsAvailable=false` when
`RocketMQClusterProvider.enrichBrokerWithRuntimeInfo` could not read them. The
cluster page's Broker tab ignored the flag:
```tsx
sorter: (a, b) => a.diskUsage - b.diskUsage,
render: (v: number) => <Progress percent={v} size="small" ... />
sorter: (a, b) => a.tpsIn - b.tpsIn,
render: (v: number) => v.toLocaleString(),
```
so such a broker shows a blue **0% disk bar** and **TPS 0** - "empty disk,
no traffic" - and sorts among the genuinely idle brokers, first in an ascending
scan. The version cell of the same row already renders `-`, and the studio
cluster page honours the flag (`web/src/pages/studio/BrokerCluster.tsx:144-147`
maps it to `null` and renders `-`). The mock and the test fixture never set the
flag, so the suite could not see it.
### Steps to Reproduce
1. Open Cluster → Broker for a cluster where one broker's runtime stats read
fails.
2. That row shows 0% disk usage and TPS 0 while the cluster status is a
warning.
3. Sort by 磁盘使用率 ascending: the unmeasured broker leads the list.
### What Did You Expect to See?
The row reports the stats as unavailable, like the studio cluster page and
like its own version cell.
### What Did You See Instead?
A fabricated zero measurement, and a sort order built on it.
### Evidence
- `web/src/pages/cluster/index.tsx` (the three columns),
`web/src/api/cluster.ts:48`, `server/.../cluster/broker/BrokerVO.java:34-42`,
`server/.../provider/apache/RocketMQClusterProvider.java:252,273-276,327`,
`web/src/pages/studio/BrokerCluster.tsx:144-147`.
- `cd web && npx vitest run src/pages/cluster/__tests__/ClusterPage.test.tsx
-t 'runtime-stats'` - the new case fails before the fix (the row contains 0%).
### Impact
An operator scanning the broker table reads "no traffic, empty disk" for a
broker that simply could not be measured, and the sort order promotes exactly
those rows.
### Acceptance Criteria
- Unavailable broker stats render as unavailable and sort after measured
values in both directions, with a regression test.
**Corresponding PR:** #ISSUEPR#
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]