Skip to content

Scenarios

Olivier edited this page Apr 22, 2026 · 1 revision

๐Ÿ“– Automated Audit Archiving & Scenarios

๐Ÿ—๏ธ Naming Convention: The Audit Trail

In production environments (like Celery workers), you might run hundreds of tasks per hour. RAM-FLOW uses a standardized, sortable, and unique naming engine to prevent overwrites:

YYYYMMDD_HHMMSS_{ENV}_{SUFFIX}.html

This traceable footprint is vital for Post-Mortem Analysis, allowing you to compare memory trends across different days, deployments, or server environments.

โš™๏ธ Configuration

  • Default: Reports are stored in .memory_audits/ at your project root.
  • Environment Override: Change the destination globally for your server:
    export RAMFLOW_REPORTS_DIR=/var/log/ramflow
  • Script Override: Define a custom folder or suffix on-the-fly:
    tracker.generate_report(folder="logs/sync", suffix="oracle_export")
    # Output: logs/sync/20260419_153005_production_oracle_export.html

๐ŸŽฎ Story-Driven Scenarios (Interactive Demos)

We have built "Flight Simulations" into the library to help teams understand and identify memory lifecycles and pitfalls.

๐Ÿ”ด Scenario A: The Forgotten Search Cache

  • The Story: A developer pulls 5,000 records from Oracle. To "optimize" the next run, they save the results in a global Python dictionary but forget to clear the reference.
  • The Pitfall: The cache grows every time the worker runs, leading to a slow but inevitable OOM crash in production.
  • The Verdict: RAM-FLOW detects a High Memory Plateau. Even if subsequent tasks use 0 MB, the report triggers a CRITICAL BLOAT alert.
  • Run: uv run examples/demo_forgotten_cache.py

๐ŸŸข Scenario B: The Triumph of the Optimized Pipeline

  • The Story: The same engine, but upgraded with a Lean Engine approach: surgical _source filtering and an explicit .clear() call once the data is processed.
  • The Verdict: RAM-FLOW confirms the "Aircraft" is empty and stabilized. The report is issued with a CERTIFIED LEAK-FREE badge.
  • Run: uv run examples/scenario_clean_execution.py