Class: CacheStache::DashboardController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
# File 'app/controllers/cache_stache/dashboard_controller.rb', line 5

def index
  window = parse_window(params[:window])
  @results = StatsQuery.new(window: window).execute
  @config = CacheStache.configuration
  @storage_estimate = CacheClient.new(@config).estimate_storage_size
end

#keyspaceObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/cache_stache/dashboard_controller.rb', line 12

def keyspace
  @config = CacheStache.configuration
  @keyspace = @config.keyspaces.find { |ks| ks.name == params[:name].to_sym }

  unless @keyspace
    render plain: "Keyspace not found", status: :not_found
    return
  end

  window = parse_window(params[:window])
  @results = StatsQuery.new(window: window).execute
  @keyspace_stats = @results[:keyspaces][@keyspace.name]
end