[
https://issues.apache.org/jira/browse/KAFKA-2419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14737756#comment-14737756
]
Aditya Auradkar commented on KAFKA-2419:
----------------------------------------
[~junrao][~jjkoshy] We have a couple of ways to solve this problem. Let me know
which approach you prefer.
1. Generic Time based
- In this approach, we can mark any sensor as "transient". After a certain
period of inactivity i.e. no record called for x minutes, we can remove the
sensor and its associated metrics, unregister from all MetricReporters. Here,
we can build the notion of time based retention into the root Metrics object
itself i.e. periodically iterate through sensors and remove transient sensors
that are deemed inactive. Is this a useful addition to the metrics library or
does it only make sense for Quotas?
2. Time Based but keep time computation in Quota code.
- In this approach, the ClientQuotaManager can keep track of the last record
time and trigger deleteSensor requests to the Metrics object. The metrics
library will only understand creation and deletion of sensors.
3. Explicit deletion
- (First suggested by Joel in 2084) Only delete sensors explicitly. For quotas,
this involves keeping track of client disconnections. This is tricky to do
correctly because connections/disconnections are handled in the Selector per
SocketChannel and we need to start tracking number of connections per unique
clientId.
> 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.8.3
> Reporter: Aditya Auradkar
> Assignee: Aditya Auradkar
> Priority: Blocker
> Labels: quotas
> Fix For: 0.8.3
>
>
> 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)