feat(activity): add performance metrics and logging #325

Merged
fuzzy merged 1 commit from phase07-metrics-logging into main 2026-07-07 12:58:41 +00:00
Owner

What

Add timing and logging to key operations, completing #266 and Phase 7.

Log output examples

2026/07/07 04:42:03 [activity] cache miss for user/alice, fetching since 2026-06-30
2026/07/07 04:42:03 [activity] fetch 2 events (1 pages, 1 days) in 12ms
2026/07/07 04:42:03 [activity] refreshed user/alice (1 days) in 15ms
  • [activity] fetch — event count, pages fetched, days aggregated, duration
  • [activity] cache hit/miss — context key, days in cache, why fetched
  • [activity] refreshed — total refresh duration including fetch + upsert
  • [activity] render pass1 — only when >1ms (silent for fast renders)

Phase 7 complete

# Task Status
#258 Memory-efficient rendering
#262 Optimize API fetch
#266 Performance metrics

References: #266, #263, #264, #265

Testing

  • go test -race ./... — all pass
## What Add timing and logging to key operations, completing #266 and **Phase 7**. ### Log output examples ``` 2026/07/07 04:42:03 [activity] cache miss for user/alice, fetching since 2026-06-30 2026/07/07 04:42:03 [activity] fetch 2 events (1 pages, 1 days) in 12ms 2026/07/07 04:42:03 [activity] refreshed user/alice (1 days) in 15ms ``` - **[activity] fetch** — event count, pages fetched, days aggregated, duration - **[activity] cache hit/miss** — context key, days in cache, why fetched - **[activity] refreshed** — total refresh duration including fetch + upsert - **[activity] render pass1** — only when >1ms (silent for fast renders) ### Phase 7 complete | # | Task | Status | |---|------|--------| | #258 | Memory-efficient rendering | ✓ | | #262 | Optimize API fetch | ✓ | | #266 | Performance metrics | ✓ | References: #266, #263, #264, #265 ## Testing - [x] `go test -race ./...` — all pass
feat(activity): add performance metrics and logging
All checks were successful
Test and Release / test (pull_request) Successful in 3m43s
Test and Release / lint (pull_request) Successful in 4m36s
93c8d2bed7
- FetchActivityEvents: logs '[activity] fetch N events (N pages, N
  days) in DURATION'
- RefreshContext: logs cache hit/miss, fetch failures with stale
  fallback, and total refresh duration
- RenderPass1: logs when render takes >1ms for debugging slow renders
- All logs prefixed with [activity] for easy grep filtering
- Minimal overhead — timing only on operations that matter

Ref: #266, #263, #264, #265
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-07 12:55:15 +00:00
fuzzy added this to the Steeper project 2026-07-07 12:55:20 +00:00
fuzzy self-assigned this 2026-07-07 12:55:22 +00:00
the.auditor left a comment

Review

Result: Approved — no blocking issues.

Summary: Adds timing and diagnostic logging across the activity pipeline. FetchActivityEvents logs event count, pages, days, duration. RefreshContext logs cache hit/miss, stale fallbacks, and total refresh duration. RenderPass1 logs render time when >1ms (silent for fast renders). ROADMAP2.md updated — Phase 7 fully complete.

Checklist:

  • Correctness: Timing correct, logs at appropriate granularity, silent for fast renders
  • Completeness: Closes #266 — fetch timing, event counts, cache hit/miss tracking, render timing
  • Race-safe: go test -race passes
  • Maintainability: Structured [activity] prefix for grep-ability
## Review **Result: Approved** — no blocking issues. **Summary:** Adds timing and diagnostic logging across the activity pipeline. `FetchActivityEvents` logs event count, pages, days, duration. `RefreshContext` logs cache hit/miss, stale fallbacks, and total refresh duration. `RenderPass1` logs render time when >1ms (silent for fast renders). ROADMAP2.md updated — Phase 7 fully complete. **Checklist:** - Correctness: ✅ Timing correct, logs at appropriate granularity, silent for fast renders - Completeness: ✅ Closes #266 — fetch timing, event counts, cache hit/miss tracking, render timing - Race-safe: ✅ `go test -race` passes - Maintainability: ✅ Structured `[activity]` prefix for grep-ability
fuzzy merged commit 93c8d2bed7 into main 2026-07-07 12:58:41 +00:00
fuzzy deleted branch phase07-metrics-logging 2026-07-07 12:58:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/steeper!325
No description provided.