analytics
analytics
¶
Aggregated statistics engine for the Marianne Dashboard.
Computes dashboard-wide analytics from daemon job data via
DaemonStateAdapter. All methods use a TTL-based cache to avoid
hammering IPC on concurrent page loads.
Aggregation logic lives in module-level pure functions so it can be tested independently of the cache and IPC layers.
Attributes¶
Classes¶
DaemonAnalytics
¶
Compute aggregate statistics from daemon job data.
Parameters¶
adapter:
A StateBackend (typically DaemonStateAdapter) used to
fetch live job data.
cache_ttl:
Default time-to-live in seconds for cached results (default 10.0).
Source code in src/marianne/dashboard/services/analytics.py
Functions¶
get_stats
async
¶
Dashboard stats: total, running, completed, failed, success_rate, total_spend, throughput_sheets_per_hour.
cost_rollup
async
¶
validation_stats
async
¶
Validation pass rates by rule type, overall pass rate.
error_breakdown
async
¶
Error counts by category: transient, rate_limit, permanent.
duration_stats
async
¶
Avg sheet duration, total job durations, slowest sheets.