lhotari commented on code in PR #22058:
URL: https://github.com/apache/pulsar/pull/22058#discussion_r1502135410
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:
##########
@@ -175,6 +199,12 @@ public NamespaceService(PulsarService pulsar) {
this.bundleSplitListeners = new CopyOnWriteArrayList<>();
this.localBrokerDataCache =
pulsar.getLocalMetadataStore().getMetadataCache(LocalBrokerData.class);
this.redirectManager = new RedirectManager(pulsar);
+
+ this.lookupLatencyHistogram = pulsar.getOpenTelemetry().getMeter()
+ .histogramBuilder("pulsar.broker.lookup.request.duration")
+ .setDescription("Lookup request duration")
+ .setUnit("s")
Review Comment:
Is there a specific reason to use second as a unit for latency?
I'd assume that microseconds or nanoseconds would be more useful and avoid
unnecessary floating point number operations.
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/common/stats/package-info.java:
##########
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+/**
+ * Provides metric utility classes.
+ */
+package org.apache.pulsar.common.stats;
Review Comment:
since this is the `pulsar-broker-common` module, I think that we should use
a package under `org.apache.pulsar.broker` to prevent the problem of split
packages.
`pulsar-common` already contains the `org.apache.pulsar.common.stats`
package, so that package name is already taken. Split packages aren't allowed
in Java Platform Modules System (JPMS, Java 9 modules) either.
--
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]