Skip to content

Cookbook

Real-world recipes and production patterns for TimeRun: web frameworks, telemetry pipelines, AI/LLM token streaming, structured logging, and latency analysis.


Observability & Telemetry

Web & AI Applications

  • Time web requests — Middleware patterns for FastAPI (Starlette), Flask, and Django to capture wall and CPU latency per HTTP request.
  • Time LLM token streaming — Measure Time to First Token (TTFT) and total generation time across streaming AI/LLM responses.

Analysis & Performance

  • Analyze results — Collect measurements to compute statistical summaries, confidence intervals, and percentiles (p50, p99) using NumPy and SciPy.
  • Overhead & benchmarks — Verification of TimeRun's sub-microsecond overhead and patterns for micro-benchmarking algorithms.