Class: RailsPulse::DashboardController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RailsPulse::DashboardController
- Includes:
- TimeRangeConcern
- Defined in:
- app/controllers/rails_pulse/dashboard_controller.rb
Instance Method Summary collapse
Methods included from TimeRangeConcern
#default_time_range_key, #setup_time_range
Methods inherited from ApplicationController
#set_global_filters, #set_time_range
Methods included from PaginationConcern
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/rails_pulse/dashboard_controller.rb', line 5 def index # Use TimeRangeConcern to get time range (supports time range selector + all other filters) @start_time, @end_time, @selected_time_range, @time_diff = setup_time_range # Convert time range to period in days for dashboard cards/charts @period = ((@end_time - @start_time) / 1.day).round # Determine period type based on time range # If 24 hours or less, use hourly summaries, otherwise use daily @period_type = @period <= 1 ? "hour" : "day" # Get tag filter values from session = show_non_tagged = session[:show_non_tagged] != false @percentile_response_times_metric_card = RailsPulse::Routes::Cards::PercentileResponseTimes.new(route: nil, disabled_tags: , show_non_tagged: show_non_tagged, period: @period, period_type: @period_type).to_metric_card @request_count_totals_metric_card = RailsPulse::Routes::Cards::RequestCountTotals.new(route: nil, disabled_tags: , show_non_tagged: show_non_tagged, period: @period, period_type: @period_type).to_metric_card @error_rates_metric_card = RailsPulse::Routes::Cards::ErrorRates.new(route: nil, disabled_tags: , show_non_tagged: show_non_tagged, period: @period, period_type: @period_type).to_metric_card @job_failure_rate_metric_card = RailsPulse::Jobs::Cards::FailureRate.new(period: @period, period_type: @period_type).to_metric_card if RailsPulse.configuration.track_jobs # Generate chart data for inline rendering @response_time_percentiles_chart_data = RailsPulse::Dashboard::Charts::ResponseTimePercentiles.new(disabled_tags: , show_non_tagged: show_non_tagged, period: @period, period_type: @period_type).to_chart_data @throughput_and_errors_chart_data = RailsPulse::Dashboard::Charts::ThroughputAndErrors.new(disabled_tags: , show_non_tagged: show_non_tagged, period: @period, period_type: @period_type).to_chart_data # Needs Attention panel @needs_attention = RailsPulse::Dashboard::NeedsAttention.new(disabled_tags: , show_non_tagged: show_non_tagged, period: @period).to_attention_data # System Health bar @health_summary = RailsPulse::Dashboard::HealthSummary.new(disabled_tags: , show_non_tagged: show_non_tagged, period: @period).to_health_data end |