Frun1na opened a new issue, #6097:
URL: https://github.com/apache/rocketmq-dashboard/issues/6097

   ### Before Creating the Bug Report
   
   - [x] I have searched the [open 
issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository 
and believe that this is not a duplicate.
   - [x] This is a defect in RocketMQ Studio, not a usage question and not a 
defect in another Apache RocketMQ repository.
   - [x] I can reproduce this on the current `rocketmq-studio` branch, or I 
have stated the exact version I am running below.
   
   ### Studio Version
   
   branch: rocketmq-studio
   git commit id: 5e4c39b0
   deployed as: reproduced by unit tests against that commit
   
   ### Runtime Environment
   
   OS: Ubuntu on WSL2
   MySQL: not applicable — the defect is in the topic response contract and in 
the console rendering, not in persistence
   browser (for UI issues): not applicable — reproduced with jsdom in a vitest 
run
   
   ### Connected RocketMQ Cluster
   
   not applicable — reproduced with a stubbed provider in a unit test. The 
fields are unset for every
   vendor, so no live cluster changes the outcome.
   
   ### Describe the Bug
   
   `TopicVO.messageCount`, `TopicVO.tps` and `TopicVO.consumerGroupCount` are 
declared, serialized and
   rendered, but no provider ever assigns them: the topic list and the topic 
detail report **0 messages,
   0 TPS and 0 consumer groups for every topic**.
   
   Evidence, at `5e4c39b0`:
   
   - `TopicVO` has nine construction sites — 
`RocketMQMetadataProvider.toTopicVO` (`:198`),
     `RocketMQAdminClientImpl` (`:119`), `TencentInstanceProvider` (`:1001`),
     `AliyunConverters` (`:120`), `CreateTopicDTO.toTopicVO`, 
`UpdateTopicDTO.toTopicVO`,
     `TopicController` (`:82`), `TopicInput` and `TopicUpdateInput`. None of 
them writes these three
     fields, and no other production code does either: a repository-wide search 
finds only reads.
   - `MetadataService.buildTopicCsv` (`:899-903`) exports `Message Count`, 
`TPS` and `Consumer Groups`
     from those getters, so the topic CSV always contains `"0","0.0","0"`.
   - The topic detail drawer (`web/src/pages/instance/topic.tsx:1225-1227`) 
renders 今日消息量 / TPS /
     消费者组数 from the same fields, and the web CSV export 
(`web/src/services/topicService.ts:28-29`)
     repeats two of them.
   - `web/src/api/metadata.ts:18-20` declares all three as required numbers, and
     `web/src/services/topicService.ts:116-118` invents `messageCount: 0, tps: 
0, consumerGroupCount: 0`
     for a locally created topic.
   - The AI tools `rmq.topic.list` and `rmq.topic.detail` forward the same 
zeros and their catalog
     schemas list the three fields as required, so an assistant reports them as 
measured values.
   - The only producers anywhere are fixtures: `MetadataServiceTest.topic(...)` 
writes 100 / 2.5 / 3 and
     `web/src/mock/topics.ts` fills the mock list, which is why the defect is 
invisible in mock mode and
     in tests.
   
   ### Steps to Reproduce
   
   1. Run the server case added in the pull request below at `5e4c39b0`:
   
      `cd server && mvn -B -ntp test 
-Dtest=MetadataServiceTest#exportTopicsShouldNotPublishStatisticsNoProviderComputesTest`
   
   2. Or, against a live deployment: `GET /api/topics?instanceId=...` returns 
`messageCount`, `tps` and
      `consumerGroupCount` for every topic; they are `0`, `0.0` and `0` 
regardless of traffic. The topic
      detail drawer and the CSV export show the same values.
   
   ### What Did You Expect to See?
   
   Either statistics the server actually computes, or no statistic at all. A 
measured `0` for a busy
   topic is worse than an absent value: the console and the assistant both 
state that the topic has no
   messages and no consumers.
   
   ### What Did You See Instead?
   
   `0` messages, `0.0` TPS and `0` consumer groups on every topic, in the topic 
detail drawer, in both
   CSV exports and in the two AI tool outputs, with the contract declaring all 
three as required fields.
   
   ### Additional Context
   
   `#5600` removed the NameServer tab's fabricated "Connections" column for the 
same reason — the value
   was `0` for every row and the field was dropped instead of being filled with 
a guess. A fix with
   regression tests follows in a pull request.
   
   ### Are You Willing to Submit a Pull Request?
   
   - [x] Yes, I am willing to submit a pull request.
   


-- 
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]

Reply via email to