foreman/app/controllers/statistics_controller.rb @ d97375e0
300c8b44 | Ohad Levy | class StatisticsController < ApplicationController
|
|
def index
|
|||
begin
|
|||
@os_count = Host.count_distribution :operatingsystem
|
|||
@arch_count = Host.count_distribution :architecture
|
|||
@env_count = Host.count_distribution :environment
|
|||
@klass_count = Host.count_habtm "puppetclass"
|
|||
@cpu_count = FactValue.count_each "processorcount"
|
|||
@model_count = FactValue.count_each "manufacturer"
|
|||
@mem_size = FactValue.mem_average "memorysize"
|
|||
@mem_free = FactValue.mem_average "memoryfree"
|
|||
@swap_size = FactValue.mem_average "swapsize"
|
|||
@swap_free = FactValue.mem_average "swapfree"
|
|||
32e8c048 | Ohad Levy | rescue Exception => e
|
|
logger.error e
|
|||
300c8b44 | Ohad Levy | render :text => "No Inventory data has been found - add some hosts and facts and try again", :layout => true
|
|
end
|
|||
end
|
|||
end
|