lhotari commented on code in PR #25309:
URL: https://github.com/apache/pulsar/pull/25309#discussion_r2918506672
##########
pulsar-client/src/test/java/org/apache/pulsar/client/impl/ProducerImplTest.java:
##########
@@ -46,7 +46,7 @@ public void testChunkedMessageCtxDeallocate() {
for (int i = 0; i < totalChunks; i++) {
ProducerImpl.OpSendMsg opSendMsg =
ProducerImpl.OpSendMsg.create(
- LatencyHistogram.NOOP,
+ (ProducerMetrics) null,
Review Comment:
Instead of using `null`, it's better to have a no-op ProducerMetric
instantiated with `InstrumentProvider.NOOP`. That could be instantiated in a
final field in the test class.
Same comment applies to other cases in this test class.
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/metrics/ProducerMetrics.java:
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.client.impl.metrics;
+
+import io.opentelemetry.api.common.Attributes;
+
+public class ProducerMetrics {
Review Comment:
add javadoc explaining the purpose of this class
##########
pulsar-client/src/test/java/org/apache/pulsar/client/impl/OpSendMsgQueueTest.java:
##########
@@ -41,7 +41,7 @@ public void createMockMessage() {
}
private ProducerImpl.OpSendMsg createDummyOpSendMsg() {
- return ProducerImpl.OpSendMsg.create(LatencyHistogram.NOOP, message,
null, 0L, null);
+ return ProducerImpl.OpSendMsg.create((ProducerMetrics) null, message,
null, 0L, null);
Review Comment:
Instead of using `null`, it's better to have a no-op ProducerMetric
instantiated with `InstrumentProvider.NOOP`. That could be instantiated in a
final field in the test class.
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/metrics/ConsumerMetrics.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.client.impl.metrics;
+
+import io.opentelemetry.api.common.Attributes;
+
+public class ConsumerMetrics {
Review Comment:
add javadoc explaining the purpose of this class
--
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]