You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "SzyWilliam (via GitHub)" <gi...@apache.org> on 2023/07/05 03:32:23 UTC
[GitHub] [iotdb] SzyWilliam commented on a diff in pull request #10448: [IOTDB-6046] Refactor Ratis metrics Reporting in read/write
SzyWilliam commented on code in PR #10448:
URL: https://github.com/apache/iotdb/pull/10448#discussion_r1252498849
##########
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/RatisMetricsManager.java:
##########
@@ -26,12 +26,50 @@
import org.apache.iotdb.metrics.utils.MetricLevel;
import java.util.concurrent.TimeUnit;
+import java.util.function.BiConsumer;
public class RatisMetricsManager {
+
+ static class TimeKeeper implements AutoCloseable {
+ private final long startMoment;
+ private final TConsensusGroupType groupType;
+ private final BiConsumer<Long, TConsensusGroupType> reporter;
+
+ private TimeKeeper(
+ BiConsumer<Long, TConsensusGroupType> reporter, TConsensusGroupType groupType) {
Review Comment:
primitive types are not allowed for Functional interfaces. Besides, the boxing & unboxing costs are trivial in metric reporting operation.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org