luoyuxia commented on code in PR #1729:
URL: https://github.com/apache/fluss/pull/1729#discussion_r2371475060
##########
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:
> @luoyuxia I have another idea. The `pendingRecords` and the `timestampLag`
are the two indicators representing the delay situation. Then, the
`LakeMaxTimestamp` and `LakeLogEndOffset` can only be negative when they are
initialized, right? So in this case, can we return localMaxTimestamp and
LocalLogEndOffset?
I suggest to return -1 explicitly
--
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]