feat: queue depth trend sparkline on dashboard#36
Merged
Conversation
Add a "Queue Depth — Last 12 Hours" card to the dashboard showing estimated queue depth at 12 hourly snapshots. Depth at time T is computed as jobs created before T that have not yet finished by T — DB-agnostic via a single pluck and Ruby-side grouping, mirroring the throughput chart pattern. Bars are purple to distinguish from the blue throughput and red failure rate charts. Empty state shown when no active jobs exist in the window. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move all four index queries (stats, throughput, sparkline, depth_sparkline) out of DashboardController into DashboardStats, mirroring the QueueStats pattern. Controller index action is now 5 lines. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Controller index action is now one line. DashboardStats#stats renamed to #counts to avoid @stats.stats in the view. View uses dot notation: @stats.counts[:key], @stats.throughput, @stats.sparkline, @stats.depth_sparkline. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
DashboardController#discard_all_blocked was a custom-named action; extract it to BlockedJobsController#destroy following the 7-action Rails convention. Dashboard "Retry All Failed" button now routes to the existing RetryFailedJobsController#create (retry_all_failed_jobs_path) eliminating DashboardController#retry_all_failed as well. Routes: drop two custom POST routes; add singular resource :blocked_jobs. Specs: move blocked-jobs coverage to blocked_jobs_spec.rb; retry_all coverage already exists in failed_jobs_spec.rb. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Track remaining non-standard actions: QueuesController pause/resume and Queues::JobsController discard_all. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pluck(:created_at, :finished_at)and Ruby-side grouping, matching the throughput chart patternTest plan
bundle exec rake dev:reset) and visit/jobs— the "Queue Depth — Last 12 Hours" card appears below the throughput chart with purple bars🤖 Generated with Claude Code