Skip to content

Conversation

@Puttrix
Copy link
Owner

@Puttrix Puttrix commented Dec 5, 2025

Summary

Delivers historical backfill mode for generating timestamped visits over configurable past windows (30–180 days).

Changes

  • Config validation: Date windows (≤180d, no future dates), caps, TZ guards, seed/RPS constraints
  • Env mapping: Backend status model fields for backfill state
  • UI controls: Config tab Backfill section (toggle, date pickers or days_back+duration, caps, seed, RPS)
  • Status dashboard: Backfill Status panel showing activation and config summary
  • Loader: TZ-aware backfill loop with per-day/global caps, deterministic seeds, optional RPS throttle
  • Testing: pytest coverage for window guardrails and caps (4 tests in test_backfill.py)
  • Documentation: WEB_UI_GUIDE and presets/README updated with backfill usage

Commits

  • fb0dc9d feat: add backfill config validation and env mapping
  • 8f673aa feat: add backfill config UI and documentation
  • 68b98db test: add backfill validation coverage
  • 1843a4b feat: deliver backfill mode with tests and docs
  • dac8329 feat: show backfill status on dashboard

Closes

  • P-032 Historical backfill mode (date-ranged traffic replay)

Matomo's cdt parameter expects timestamps in UTC timezone, but we were
sending local timezone timestamps (e.g., CET) without conversion.
This caused backfill visits to appear at incorrect times in Matomo.

Changes:
- Add format_cdt() helper that converts timezone-aware datetimes to UTC
- Replace all strftime calls for cdt param with format_cdt()
- Add test_format_cdt_converts_to_utc() to verify conversion

Example:
- Before: 14:30 CET sent as '2025-12-01 14:30:00' (Matomo interprets as UTC)
- After:  14:30 CET sent as '2025-12-01 13:30:00' (correct UTC equivalent)

Fixes P-032 backfill not sending data to correct dates.
Standalone script to verify backfill functionality against a local Matomo:
- Sends test visits with historical timestamps (UTC-converted)
- Validates Matomo connectivity and token_auth
- Reports success/failure by date
- Provides verification steps for manual inspection

Usage: MATOMO_TOKEN_AUTH='token' python3 test_backfill_local.py
@Puttrix Puttrix merged commit 99d8ab4 into main Dec 8, 2025
2 checks passed
@Puttrix Puttrix deleted the develop branch December 8, 2025 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants