Add perPartition parameter to partitioned-stats API (#4639)
### Motivation Currently, the partitioned-stats API response includes stats for each partition. However, if the number of partitions and clients is large, the size of the response will be very large. In such cases, it is useful to have a query parameter to get a response that does not include stats for each partition. ```sh $ curl -s http://localhost:8080/admin/persistent/sample/standalone/ns1/pt1/partitioned-stats | jq . { "msgRateIn": 0, "msgThroughputIn": 0, "msgRateOut": 0, "msgThroughputOut": 0, "averageMsgSize": 0, "storageSize": 0, "publishers": [], "subscriptions": { "sub1": { "msgRateOut": 0, "msgThroughputOut": 0, "msgRateRedeliver": 0, "msgBacklog": 0, "blockedSubscriptionOnUnackedMsgs": false, "msgDelayed": 0, "unackedMessages": 0, "msgRateExpired": 0, "consumers": [], "isReplicated": false } }, "replication": {}, "metadata": { "partitions": 2 }, "partitions": { "persistent://sample/standalone/ns1/pt1-partition-1": { "msgRateIn": 0, "msgThroughputIn": 0, "msgRateOut": 0, "msgThroughputOut": 0, "averageMsgSize": 0, "storageSize": 0, "publishers": [], "subscriptions": { "sub1": { "msgRateOut": 0, "msgThroughputOut": 0, "msgRateRedeliver": 0, "msgBacklog": 0, "blockedSubscriptionOnUnackedMsgs": false, "msgDelayed": 0, "unackedMessages": 0, "msgRateExpired": 0, "consumers": [], "isReplicated": false } }, "replication": {}, "deduplicationStatus": "Disabled" }, "persistent://sample/standalone/ns1/pt1-partition-0": { "msgRateIn": 0, "msgThroughputIn": 0, "msgRateOut": 0, "msgThroughputOut": 0, "averageMsgSize": 0, "storageSize": 0, "publishers": [], "subscriptions": { "sub1": { "msgRateOut": 0, "msgThroughputOut": 0, "msgRateRedeliver": 0, "msgBacklog": 0, "blockedSubscriptionOnUnackedMsgs": false, "msgDelayed": 0, "unackedMessages": 0, "msgRateExpired": 0, "consumers": [], "isReplicated": false } }, "replication": {}, "deduplicationStatus": "Disabled" } } } ``` ### Modifications Added query parameter named `perPartition` to the partitioned-stats API. The default value is true.
Showing
想要评论请 注册 或 登录