[Art Studio][Backend] Metrics & activity read-model (event-handler projection) #389

Closed
opened 2026-07-05 12:12:14 +00:00 by spikerj · 1 comment
Owner

Epic #382. Backend prerequisite for the Metrics dashboard (#391) and System Activity panel (#390) — these need queryable aggregates, not just UI.

Scope (event-handler-driven, our architecture): Add a projection that consumes the existing ArtStudio stage/lifecycle events off RabbitMQ and maintains read-model aggregates in Mongo (and/or Redis TimeSeries for velocity): total/active/review-backlog counts, accept rate, avg quality, avg cycle time, per-stage timing, throughput/daily, event-type breakdown, recent failures, processing burndown, and a rolling live-activity feed + "now running" set. Expose read-only api/artstudio/metrics and api/artstudio/activity (Api → MediatR query; heavy work stays out of Api per worker-architecture rule). Emit telemetry (Jaeger:EndPoint, trace context on consume via ActivityHelper).

Type: backend (Api query + EventHandler projection). Deps: existing ArtStudio event stream.
Port vs tweak: our CQRS read-model backing Eric's metrics/activity views.
Test: projection folds a sequence of stage events into correct aggregates (unit); query endpoints return the read model (integration).

Epic #382. Backend prerequisite for the Metrics dashboard (#391) and System Activity panel (#390) — these need *queryable aggregates*, not just UI. **Scope (event-handler-driven, our architecture):** Add a projection that consumes the existing ArtStudio stage/lifecycle events off RabbitMQ and maintains read-model aggregates in Mongo (and/or Redis TimeSeries for velocity): total/active/review-backlog counts, accept rate, avg quality, avg cycle time, per-stage timing, throughput/daily, event-type breakdown, recent failures, processing burndown, and a rolling live-activity feed + "now running" set. Expose read-only `api/artstudio/metrics` and `api/artstudio/activity` (Api → MediatR query; heavy work stays out of Api per worker-architecture rule). Emit telemetry (`Jaeger:EndPoint`, trace context on consume via `ActivityHelper`). **Type:** backend (Api query + EventHandler projection). **Deps:** existing ArtStudio event stream. **Port vs tweak:** our CQRS read-model backing Eric's metrics/activity views. **Test:** projection folds a sequence of stage events into correct aggregates (unit); query endpoints return the read model (integration).
Author
Owner

Merged to master via spikersoft-backend#101 (consolidated Art Studio backend slice). Metrics/activity read-model + SpikerSoft.EventHandlers.ArtStudioMetrics projector + api/artstudio/metrics//activity endpoints landed. Build 0 errors; 534 ArtStudio unit tests green on the consolidated branch. Frontend consumers in spikersoft-angular#132.

✅ Merged to master via **spikersoft-backend#101** (consolidated Art Studio backend slice). Metrics/activity read-model + `SpikerSoft.EventHandlers.ArtStudioMetrics` projector + `api/artstudio/metrics`/`/activity` endpoints landed. Build 0 errors; 534 ArtStudio unit tests green on the consolidated branch. Frontend consumers in spikersoft-angular#132.
Sign in to join this conversation.