Skip to content

Add cache hit field in Item #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v8
Choose a base branch
from

Conversation

zacscoding
Copy link

Add cache hit field in Item.

Hello :) I want to record cache metrics with labels when calling Once function like below

	item := &Item{}
	if err := cache.Once(item); err != nil {
		return err
	}

	metrics.IncCacheTotal("product")
	if item.CacheHit {
		metrics.IncCacheHit("product")
	}

I found Stats() function but this function provides only total count of hits and misses :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant