Class: Llmemory::Dashboard::StatsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/llmemory/dashboard/stats_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/llmemory/dashboard/stats_controller.rb', line 6

def index
  @user_id = params[:user_id]
  @sessions = short_term_store.list_sessions(user_id: @user_id)

  if graph_based?
    @nodes_count = graph_based_storage.count_nodes(@user_id)
    @edges_count = graph_based_storage.count_edges(@user_id)
  else
    @items_count = file_based_storage.count_items(user_id: @user_id)
    @categories_count = file_based_storage.list_categories(@user_id).size
    @resources_count = file_based_storage.list_resources(user_id: @user_id).size
  end
end