Skip to content

Indicate if an eviction is from hot or cold to Lifecycle eviction functions #39

Closed

Description

@pushrax

I'm using Lifecycle to emit entry age metrics, it would be nice to distinguish between cold evictions and hot evictions so we can tag the metrics separately and more clearly see how the cache is performing.

I'm open to making a patch for this. For backwards compatibility it make sense to add provided methods to the Lifecycle trait with the new signature, and have them just call on_evict/before_evict?

Activity

  1. arthurprs commented on Jul 25, 2024

    @arthurprs
    Owner

    That makes sense. Although the hit ratio is still the most representative metric.

    I'd accept such a change, barring any surprises in terms of invasiveness.

  2. added
    enhancement
    on Sep 1, 2024
  3. DenizUgur commented on May 7, 2026

    @DenizUgur
    Contributor

    This would make sense for iter as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions