core.cache.debug ================ .. py:module:: core.cache.debug Functions --------- .. autoapisummary:: core.cache.debug._decode core.cache.debug._describe core.cache.debug.analyze_cache_queries Module Contents --------------- .. py:function:: _decode(value: Any) -> str .. py:function:: _describe(args: tuple[Any, ...]) -> tuple[str, str] .. py:function:: analyze_cache_queries(report: Literal['summary', 'redundant', 'all'] = 'summary') -> collections.abc.Iterator[None] Analyzes the redis commands executed during its context. Mirrors :func:`onegov.core.orm.debug.analyze_sql_queries`. There are three levels of information (report argument): * 'summary' (only show the number of commands) * 'redundant' (show summary and the keys hit more than once) * 'all' (show summary and every command) Unlike hooking our :class:`RedisCacheRegion`, this counts the actual commands sent to redis, so cache layers that avoid a round-trip (e.g. the request/schema caches in front of :func:`orm_cached`) don't inflate the numbers. Only two methods need hooking regardless of how the dogpile API evolves. Use this with a with-statement:: with analyze_cache_queries(): ... # <- analyzes all redis commands that happen inside here