Class: SolidLoop::DashboardController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
# File 'app/controllers/solid_loop/dashboard_controller.rb', line 3

def index
  @period = params[:period] || "hour"
end

#statsObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/solid_loop/dashboard_controller.rb', line 7

def stats
  period = params[:period] || "hour"

  render json: {
    period: period,
    llm_calls: llm_calls_by_period(period),
    tool_calls: tool_calls_by_period(period),
    cost: cost_by_period(period),
    tokens: tokens_by_period(period),
    top_agents: top_agents_by_cost(period),
    failed: failed_by_period(period),
    summary: summary_stats(period)
  }
end