dimitarndimitrov commented on code in PR #16949:
URL: https://github.com/apache/kafka/pull/16949#discussion_r1752320360


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/metrics/HdrHistogram.java:
##########
@@ -0,0 +1,145 @@
+/*
+ * 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.kafka.coordinator.group.metrics;
+
+import org.HdrHistogram.Histogram;
+import org.HdrHistogram.Recorder;
+import org.HdrHistogram.ValueRecorder;
+
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * <p>A wrapper on top of the HdrHistogram API. It handles writing to the 
histogram by delegating
+ * to an internal {@link ValueRecorder} implementation, and reading from the 
histogram by
+ * efficiently implementing the retrieval of up-to-date histogram data.
+ *
+ * <p>Note that all APIs expect a timestamp which is used by the histogram to 
discard decaying data
+ * and determine when the snapshot from which the histogram metrics are 
calculated should be
+ * refreshed.
+ */
+public final class HdrHistogram {

Review Comment:
   > Are you saying that the usage of HdrHistogram is still experimental and 
not intended from broader use?
   
   @junrao Not really, I think with the fix I've mentioned in another comment, 
this will be practically the same as an internal `HdrHistogram` implementation 
that's fairly well proven in production usage by now.
   
   I only wanted to underscore that we can't directly proclaim this as the main 
preferred histogram implementation in AK without coordinating with the other 
related efforts that we're aware of, which focus on an OpenTelemetry-based 
implementation.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to