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
Add stats for query
and cache
requests
#65
Conversation
This is actually incorrect. It doesn't return the total number of cached requests, but the current cache size. I'd implement it like this: this.stats = {
cache: 0,
query: 0,
}; and increment the counters respectively in cacheable-lookup/source/index.js Line 213 in 5b08a36
You also need to provide some tests. |
@GKosheev No need to duplicate code in the comments :) There's a |
I'm not sure if I did the unit test as you wanted me to, I tried to follow the example you sent me with the |
@szmarczak, should I change something specific in the last commit? |
@szmarczak, would that work? |
Will take a look now, sorry for delay. Also, no need to post a comment of your commit changes :) |
query
and cache
requests
Looks good! Thanks for contributing! ❤️ |
Issue #64
I implemented
get
method to get the size of cached calls: