crossoverJie commented on code in PR #22390:
URL: https://github.com/apache/pulsar/pull/22390#discussion_r1560476568
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -419,6 +420,8 @@ protected ConsumerImpl(PulsarClientImpl client, String
topic, ConsumerConfigurat
"The number of messages currently sitting in the consumer
receive queue", topic, attrs);
bytesPrefetchedGauge =
ip.newUpDownCounter("pulsar.client.consumer.receive_queue.size", Unit.Bytes,
"The total size in bytes of messages currently sitting in the
consumer receive queue", topic, attrs);
+ messageAvailablePermitsGauge =
ip.newUpDownCounter("pulsar.client.consumer.available_permits.count",
Review Comment:
> If you copied from above you need to notice `.count` was added since there
are two sub-metrics for `receive_queue`. In yours you only have one.
I noticed that `.size` is the data of the message body, but `permits` is
just a counter and does not have a size itself, so `.size` may not be needed.
---
> Also, thinking about available. Maybe if we know the limit:
>
> `pulsar.client.consumer.permit.remaining`
`pulsar.client.consumer.permit.limit`
`pulsar.client.consumer.permit.remaining`= getCurrentReceiverQueueSize() /
2- available
`pulsar.client.consumer.permit.limit`= getCurrentReceiverQueueSize() / 2
Do you mean this?
--
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]