orka.tui.data_manager module

Data management for TUI interface - statistics, caching, and data fetching.

class orka.tui.data_manager.MemoryStats(max_history: int = 100)[source]

Bases: object

Container for memory statistics with historical tracking.

update(stats: Dict[str, Any])[source]

Update current stats and add to history.

get_trend(key: str, window: int = 10) str[source]

Get trend direction for a metric.

get_rate(key: str, window: int = 5) float[source]

Get rate of change for a metric (per second).

class orka.tui.data_manager.DataManager[source]

Bases: object

Manages data fetching and caching for the TUI interface.

init_memory_logger(args)[source]

Initialize the memory logger.

update_data()[source]

Update all monitoring data.

is_short_term_memory(memory)[source]

Check if a memory entry is short-term (TTL < 1 hour).

get_filtered_memories(memory_type='all')[source]

Get memories filtered by type using actual memory_type field.

get_memory_distribution()[source]

Get distribution of memory types and log types for diagnostic purposes.

get_unified_stats()[source]

Get unified, comprehensive statistics for all TUI components. This replaces scattered calculations throughout the TUI system.

debug_memory_data()[source]

Debug method to inspect memory data structure.