lhotari commented on code in PR #25309:
URL: https://github.com/apache/pulsar/pull/25309#discussion_r2916847539


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:
##########
@@ -294,30 +285,14 @@ public ProducerImpl(PulsarClientImpl client, String 
topic, ProducerConfiguration
         }
 
         InstrumentProvider ip = client.instrumentProvider();
-        latencyHistogram = 
ip.newLatencyHistogram("pulsar.client.producer.message.send.duration",
-                "Publish latency experienced by the application, includes 
client batching time", topic,
-                Attributes.empty());
-        rpcLatencyHistogram = 
ip.newLatencyHistogram("pulsar.client.producer.rpc.send.duration",
-                "Publish RPC latency experienced internally by the client when 
sending data to receiving an ack", topic,
-                Attributes.empty());
-        publishedBytesCounter = 
ip.newCounter("pulsar.client.producer.message.send.size",
-                Unit.Bytes, "The number of bytes published", topic, 
Attributes.empty());
-        pendingMessagesUpDownCounter =
-                
ip.newUpDownCounter("pulsar.client.producer.message.pending.count", 
Unit.Messages,
-                        "The number of messages in the producer internal send 
queue, waiting to be sent", topic,
-                        Attributes.empty());
-        pendingBytesUpDownCounter = 
ip.newUpDownCounter("pulsar.client.producer.message.pending.size", Unit.Bytes,
-                "The size of the messages in the producer internal queue, 
waiting to sent", topic, Attributes.empty());
-        producersOpenedCounter = 
ip.newCounter("pulsar.client.producer.opened", Unit.Sessions,
-                "The number of producer sessions opened", topic, 
Attributes.empty());
-        producersClosedCounter = 
ip.newCounter("pulsar.client.producer.closed", Unit.Sessions,
-                "The number of producer sessions closed", topic, 
Attributes.empty());
+        producerMetrics = new ProducerMetrics(ip, topic);
+        rpcLatencyHistogram = producerMetrics.getRpcLatencyHistogram();

Review Comment:
   this isn't consistent with the way how `latencyHistogram` was handled. I'd 
assume that `rpcLatencyHistogram` would be pushed down to ProducerMetrics in a 
similar way as `latencyHistogram`.



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