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

Jun Rao commented on KAFKA-2419:
--------------------------------

It's more important to garbage collect old sensors on the broker than on the 
client. With quotas, if people run console tools, we don't want to keep the 
sensors for those client-ids forever. There are a few ways to avoid creating 
the expiration thread in the client. (1) We can create the schedule thread 
lazily (only after time-based sensors are registered). Then the clients won't 
have the expiration thread since only the brokers are using the time-based 
sensors. (2) We can also make expiration a param of the metrics constructor and 
only create the expiration thread if expiration is specified. We can then only 
use the expiration feature on the broker. It seems it's simpler if the 
expiration is specified for the whole Metrics instance than individual sensors. 
Then, when creating a sensor, we can pass in a boolean to indicate if the 
sensor should be enabled for time-based garbage collection. [~aauradkar], what 
do you think?

> Allow certain Sensors to be garbage collected after inactivity
> --------------------------------------------------------------
>
>                 Key: KAFKA-2419
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2419
>             Project: Kafka
>          Issue Type: New Feature
>    Affects Versions: 0.9.0.0
>            Reporter: Aditya Auradkar
>            Assignee: Aditya Auradkar
>            Priority: Blocker
>              Labels: quotas
>             Fix For: 0.9.0.0
>
>
> Currently, metrics cannot be removed once registered. 
> Implement a feature to remove certain sensors after a certain period of 
> inactivity (perhaps configurable).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to