Skip to content

How do I get the number of cache hits? #156

Description

@drag05

I would like to get the number of cache hits to test a newly cached function.

I know one way would be to set up a logfile. I wonder if there is any other, more elegant way to get the hits without using the logfile?
I've seen in a piece of code a utility function to the likes of memoise::stats(memoizedFun) but no-longer exists. The code example showed the number of cache hits among other things.

I have also seen a memoise:::hash_list() function that would allow inserting cache key labels which would identify each function in scripts having multiple memoised functions which, also no-longer exists.

Is this because I built the cache with cachem package?

Thank you!

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions