showuon commented on PR #15133:
URL: https://github.com/apache/kafka/pull/15133#issuecomment-1900326555

   > Most are optional comments but the blocking comments before we merge are 
the once related to removal of metrics when topic is deleted. I would assume 
that removal needs to occur from newly introduced `topicMetricValues` map in 
`BrokerTopicAggregateMetric`?
   
   @divijvaidya , thanks for your review. The metrics removal of topic deletion 
will be triggered in rlm#stopPartitions, and then 
`removeRemoteTopicPartitionMetrics` will be invoked. The removal for the 
"allTopic" metric is done via removing the partition value from the specific 
topic, ex:
   
   ```
   # We first remove the partition value from this topic
   
brokerTopicStats.topicStats(topicIdPartition.topic()).removeRemoteCopyLagBytes(partition);
   # Later, we update the topic value in the "allTopic" metric. So, once all 
partitions are removed, the value of the specific topic will be 0.
   brokerTopicStats.allTopicsStats().recordRemoteCopyLagBytes(topic, 
topicMetrics.remoteCopyLagBytes());
   ```
   
   I'll address your comments this weekend or next week. Thanks.


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