You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys
In order to monitor and improve my app, i need to know number of calls and cache hit ratio per key in certain intervals. is it possible with dogpile?
FWIW, I open sourced a Pyramid plugin to do this a few years ago, which illustrates how to accomplish this.
The package offers a DogpileLoggingProxy proxy object - derived from ProxyBackend - which is used to track all the Dogpile API calls, and stashes the metrics on the request object.
If you are using Redis as backend, you should override set_serialized and get_serialized instead as get and set are not implemented on this backend. Eg:
Activity
zzzeek commentedon Aug 29, 2021
I would implement this by intercepting calls to the backend, which you can do using ProxyBackend. we can add examples to https://dogpilecache.sqlalchemy.org/en/latest/recipes.html if someone wants to come up with this.
megan-carey commentedon Nov 19, 2021
Upvote for adding a metrics collection example to the recipes page :)
jvanasco commentedon Jan 17, 2022
FWIW, I open sourced a Pyramid plugin to do this a few years ago, which illustrates how to accomplish this.
The package offers a
DogpileLoggingProxyproxy object - derived from ProxyBackend - which is used to track all the Dogpile API calls, and stashes the metrics on the request object.https://github.com/jvanasco/pyramid_debugtoolbar_dogpile
glaucocustodio commentedon Aug 11, 2023
If you are using Redis as backend, you should override
set_serializedandget_serializedinstead asgetandsetare not implemented on this backend. Eg: