debug_toolbar.core.storage¶
Storage backend for toolbar request history using LRU cache.
Classes
|
File-backed storage for sharing data between processes. |
|
Thread-safe LRU storage for toolbar request history. |
- class debug_toolbar.core.storage.ToolbarStorage(max_size=50)[source]¶
Thread-safe LRU storage for toolbar request history.
This storage maintains a bounded history of request data, automatically evicting the oldest entries when the maximum size is reached.
- max_size¶
Maximum number of requests to store.
- __init__(max_size=50)[source]¶
Initialize the storage.
- Parameters:
max_size (
int) – Maximum number of requests to store. Defaults to 50.
- max_size¶
- store_from_context(context)[source]¶
Store data from a request context.
- Parameters:
context (
RequestContext) – The RequestContext to store.- Return type:
- class debug_toolbar.core.storage.FileToolbarStorage(file_path, max_size=50)[source]¶
File-backed storage for sharing data between processes.
Extends ToolbarStorage to persist data to a JSON file, enabling the web app and MCP server to share request history.
- file_path¶
Path to the JSON storage file.
- file_path¶