luoyuxia commented on code in PR #1729:
URL: https://github.com/apache/fluss/pull/1729#discussion_r2370869890


##########
fluss-server/src/main/java/org/apache/fluss/server/replica/Replica.java:
##########
@@ -540,11 +546,30 @@ private void onBecomeNewLeader() {
         }
     }
 
+    private void registerLakeTieringMetrics() {
+        lakeTieringMetricGroup = bucketMetricGroup.addGroup("lakeTiering");
+        lakeTieringMetricGroup.gauge(
+                MetricNames.LOG_LAKE_PENDING_RECORDS,
+                () ->
+                        getLakeLogEndOffset() < 0L
+                                ? getLogHighWatermark()
+                                : getLogHighWatermark() - 
getLakeLogEndOffset());
+        lakeTieringMetricGroup.gauge(
+                MetricNames.LOG_LAKE_TIMESTAMP_LAG,
+                () ->
+                        logTablet.getLakeMaxTimestamp() < 0L
+                                ? logTablet.getLakeMaxTimestamp()

Review Comment:
   ```suggestion
                                   ? -1
   ```
   How about using -1 to avoid `logTablet.getLakeMaxTimestamp()` being 
something weird?



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