Class: Findbug::DashboardController

Inherits:
ApplicationController show all
Defined in:
app/controllers/findbug/dashboard_controller.rb

Overview

DashboardController handles the main dashboard view.

Instance Method Summary collapse

Instance Method Details

#healthObject

GET /findbug/health

Health check endpoint for monitoring. Returns JSON with system status.



25
26
27
28
29
30
31
32
33
34
35
# File 'app/controllers/findbug/dashboard_controller.rb', line 25

def health
  status = {
    status: "ok",
    version: Findbug::VERSION,
    redis: check_redis_health,
    database: check_database_health,
    buffer: Findbug::Storage::RedisBuffer.stats
  }

  render json: status
end

#indexObject

GET /findbug

Main dashboard with overview of errors and performance.



11
12
13
14
15
16
17
18
# File 'app/controllers/findbug/dashboard_controller.rb', line 11

def index
  @stats = calculate_stats
  @recent_errors = Findbug::ErrorEvent.unresolved.recent.limit(10)
  @slowest_endpoints = Findbug::PerformanceEvent.slowest_transactions(since: 24.hours.ago, limit: 5)
  @error_trend = calculate_error_trend

  render template: "findbug/dashboard/index", layout: "findbug/application"
end

#statsObject

GET /findbug/stats

JSON stats endpoint for AJAX updates. Used by Turbo to refresh dashboard stats without full page reload.



42
43
44
# File 'app/controllers/findbug/dashboard_controller.rb', line 42

def stats
  render json: calculate_stats
end