unbridled-41 opened a new pull request, #4247:
URL: https://github.com/apache/rocketmq-dashboard/pull/4247

   Fixes #4246.
   
   ## Source
   
   - Parent project (classic dashboard, `master` of this repo): the consumer 
group list ships a sortable consume TPS column — 
`frontend-new/src/pages/Consumer/consumer.jsx:375-377` (title "TPS", 
`dataIndex: 'consumeTps'`) — and the backend fills it from the same stats 
query: 
`src/main/java/org/apache/rocketmq/dashboard/service/impl/ConsumerServiceImpl.java:258`,
 `groupConsumeInfo.setConsumeTps((int) consumeStats.getConsumeTps())` (verified 
via `git show master:...`).
   - In-repo precedent: Studio's own topic → consumers view already renders the 
same metric (`TopicConsumerVO.consumeTps`, column 消费 TPS at 
`web/src/pages/instance/topic.tsx:916-922`, i18n key `topic.consumeTps`).
   
   ## Current gap
   
   `RocketMQAdminClientImpl.fillConsumeStats` 
(server/.../provider/apache/RocketMQAdminClientImpl.java:169) calls 
`admin.examineConsumeStats(name)` — the exact call the classic dashboard uses — 
but only reads the offset table, dropping `stats.getConsumeTps()`. 
`ConsumerGroupVO` has no TPS field, the group table has no TPS column, and 
neither CSV export path includes one. Operators triaging backlog see total lag 
and delay but not the ingestion rate, so "healthy but large backlog" and 
"stalled" are indistinguishable from this page.
   
   ## Project fit
   
   - Same data, zero extra broker calls: the value comes from the 
already-issued `examineConsumeStats` response. rocketmq-tools 5.5.0 
`DefaultMQAdminExtImpl.examineConsumeStats` was decompiled (javap) and 
accumulates `consumeTps` across brokers (`dadd` + `setConsumeTps`), so the 
field is populated on real clusters.
   - Consistency: brings the group inventory in line with both the parent 
project's consumer page and Studio's own topic-consumers panel.
   - Apache provider only for now: Aliyun/Tencent group listings don't fetch 
`ConsumeStats`, so their rows keep the zero default exactly like `delaySeconds` 
already does there (established convention).
   
   ## Scope
   
   Included: `ConsumerGroupVO.consumeTps`; setting it in `fillConsumeStats`; 消费 
TPS column (sorted, `formatNumber`) on the consumer group table; `Consume TPS` 
column in both CSV exports (server `buildConsumerGroupCsv` and demo-mode 
`GROUP_EXPORT_COLUMNS`); demo data + web type/fixtures.
   
   Not included: AI tool schema changes (tools pass through the same VO), 
per-queue TPS breakdown, cloud-provider TPS (no data source), table filters.
   
   ## Implementation
   
   - `ConsumerGroupVO`: new `consumeTps` field (documented next to 
`totalLag`/`delaySeconds`).
   - `RocketMQAdminClientImpl.fillConsumeStats`: 
`vo.setConsumeTps(stats.getConsumeTps())` right after marking stats available 
(so groups with an empty offset table still surface a reported TPS of 0).
   - `MetadataService.buildConsumerGroupCsv`: `Consume TPS` column between 
`Total Lag` and `Delay Seconds`.
   - Web: `ConsumerGroup.consumeTps` type, table column with `formatNumber`, 
demo-mode export column + `createConsumerGroup` default, mock data values 
(stalled groups carry `0`, matching their delay seconds).
   
   ## Tests
   
   Red first (sources stashed, tests kept):
   
   - Backend: `mvn -o test 
-Dtest='RocketMQAdminClientImplTest,MetadataServiceTest'` → test-compile 
failure, 2 errors: `cannot find symbol setConsumeTps(double)` 
(MetadataServiceTest.java:581), `cannot find symbol getConsumeTps()` 
(RocketMQAdminClientImplTest.java:254).
   - Frontend: `npx vitest run 
src/pages/instance/__tests__/ConsumerPage.test.tsx` → `Tests 1 failed | 31 
passed (32)` — new case failed at `getByText('消费 TPS')` (column absent on 
baseline).
   
   Green after the change:
   
   - `npx vitest run src/pages/instance/__tests__/ConsumerPage.test.tsx` → 
`Tests 32 passed (32)`.
   - `mvn -o test -Dtest='RocketMQAdminClientImplTest,MetadataServiceTest'` → 
`Tests run: 84, Failures: 0, Errors: 0` (RocketMQAdminClientImplTest 47/47 
incl. new `getConsumerGroupSurfacesConsumeTpsFromConsumeStatsTest`; 
MetadataServiceTest 37/37 incl. new 
`exportConsumerGroupsShouldIncludeConsumeTpsColumn`).
   - Full backend `mvn -o test`: **2153 tests, 3 failures** — 
AuthCorsIntegrationTest ×2 and OpenAiCompatibleLlmGatewayTest (load-flaky, 
passes isolated), identical to the recorded baseline; zero new failures.
   - Full web `npx vitest run`: **982 tests, 5 failures / 4 files** — 
ClientsPage, ClusterPage, InstancePage (untouched files) and 2 ConsumerPage 
overload timeouts (~21s vs 2-3s isolated); both re-run in isolation: `1 passed 
| 31 skipped`. Same load-flaky set as the recorded baseline.
   - `npx tsc --noEmit` clean; eslint clean on all touched files; `npm run 
build` ✓ (built in 1m17s).
   
   ## Compatibility & Risk
   
   - API additively extends the group payload with one number (Jackson 
serializes primitives unconditionally; no `@JsonInclude` semantics change). 
Consumers of the JSON are unaffected.
   - CSV gains one column between `Total Lag` and `Delay Seconds`; 
positionally-parsing consumers would see the shift (spreadsheet use is the 
intended consumer).
   - Cloud instances keep `consumeTps = 0` until a provider supplies stats — 
mirrors existing `delaySeconds` behavior.
   - Head: daf15d30 (single commit, branch `feat/consumer-group-consume-tps` 
off `rocketmq-studio` @ 6c24d2ed).
   
   


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