Class: LlmCostTracker::DashboardController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/llm_cost_tracker/dashboard_controller.rb', line 5

def index
  @from_date, @to_date = overview_range
  scope = Dashboard::Filter.call(params: overview_filter_params)
  previous_scope = Dashboard::Filter.call(params: previous_filter_params)

  @stats = Dashboard::OverviewStats.call(scope: scope, previous_scope: previous_scope)
  @time_series = Dashboard::TimeSeries.call(scope: scope, from: @from_date, to: @to_date)
  @top_models = Dashboard::TopModels.call(scope: scope, limit: 5)
  @providers = Dashboard::ProviderBreakdown.call(scope: scope)
end