[ 
https://issues.apache.org/jira/browse/KAFKA-16895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17852411#comment-17852411
 ] 

Francois Visconte edited comment on KAFKA-16895 at 6/5/24 11:48 AM:
--------------------------------------------------------------------

[~chia7712] proposed a PR: https://github.com/apache/kafka/pull/16210


was (Author: JIRAUSER288982):
[~chia7712] proposed a PR

> RemoteCopyLagSegments metric taking active segment into account
> ---------------------------------------------------------------
>
>                 Key: KAFKA-16895
>                 URL: https://issues.apache.org/jira/browse/KAFKA-16895
>             Project: Kafka
>          Issue Type: Bug
>          Components: Tiered-Storage
>    Affects Versions: 3.7.0, 3.7.1
>            Reporter: Francois Visconte
>            Priority: Minor
>
> The RemoteCopyLagSegment is off by 1 because it also includes the active 
> segment into account while the RemoteCopyLagBytes does substract the size of 
> active segment: 
>            
> {code:java}
>  long bytesLag = log.onlyLocalLogSegmentsSize() - log.activeSegment().size();
> String topic = topicIdPartition.topic();
> int partition = topicIdPartition.partition();
> long segmentsLag = log.onlyLocalLogSegmentsCount();
> brokerTopicStats.recordRemoteCopyLagBytes(topic, partition, bytesLag);
> brokerTopicStats.recordRemoteCopyLagSegments(topic, partition, segmentsLag);
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to