core.cache.debug
Functions
|
|
|
|
|
Analyzes the redis commands executed during its context. |
Module Contents
- core.cache.debug.analyze_cache_queries(report: Literal['summary', 'redundant', 'all'] = 'summary') collections.abc.Iterator[None][source]
Analyzes the redis commands executed during its context. Mirrors
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
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 oform_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