Actions
Feature #1170
closedStatistics Page - Group by Hostgroups
Difficulty:
Triaged:
Description
Seems as though you have 9 pie charts and 10 would give balance...
# diff -u statistics_controller.rb statistics_controller.rb-new --- statistics_controller.rb 2011-09-14 09:47:57.712461508 -0700 +++ statistics_controller.rb-new 2011-09-14 09:47:34.372454180 -0700 @@ -5,6 +5,7 @@ @arch_count = Host.count_distribution :architecture @env_count = Host.count_distribution :environment @klass_count = Host.count_habtm "puppetclass" + @group_count = Host.gr_totals @cpu_count = FactValue.count_each "processorcount" @model_count = FactValue.count_each "manufacturer" @mem_size = FactValue.mem_average "memorysize" @@ -16,7 +17,7 @@ respond_to do |format| format.html format.json do - render :json => { :statistics => { :os_count => @os_count, :arch_count => @arch_count, + render :json => { :statistics => { :os_count => @os_count, :arch_count => @arch_count, :host_groups => @group_count, :env_count => @env_count, :klass_count => @klass_count, :cpu_count => @cpu_count, :model_count => @model_count, :mem_size => @mem_size, :mem_free => @mem_free, :swap_size => @swap_size, :swap_free => @swap_free, :mem_totsize => @mem_totsize, :mem_totfree => @mem_totfree } } # diff -u host.rb host.rb-new --- host.rb 2011-09-14 09:52:07.932460435 -0700 +++ host.rb-new 2011-09-14 09:51:46.032454329 -0700 @@ -626,4 +626,14 @@ status end + def self.gr_totals + @grouphash = {} + @hostgroups = Hostgroup.find(:all) + @hostgroups.each do |group| + @groupname = group.name + @group_count = Host.count(:all, :conditions => ["hostgroup_id = ?", group.id]) + @grouphash[@groupname] = @group_count + end + return @grouphash + end end # diff -u index.html.erb index.html.erb-new --- index.html.erb 2011-09-14 09:53:39.262459112 -0700 +++ index.html.erb-new 2011-09-14 09:53:27.452460645 -0700 @@ -17,4 +17,6 @@ <%= pie_chart("mem_totals" ,"Total memory usage", [["free memory (GB)", @mem_totfree],["used memory (GB)",@mem_totsize-@mem_totfree]]) %> + <%= pie_chart("host_groups" ,"Host Group Distribution", @group_count) %> + </center>
Updated by Ohad Levy almost 13 years ago
- Assignee set to Craig White
while in the latest view the stats are aligned, it would still be nice to have this patch, mind sending it via git as well ? :)
Updated by Benjamin Papillon about 12 years ago
- Category set to Web Interface
- Status changed from New to Assigned
- Assignee changed from Craig White to Amos Benari
Updated by Ohad Levy over 10 years ago
- Description updated (diff)
- Status changed from Assigned to New
Updated by b sh about 10 years ago
Hey,
This is a very old ticket. Should we close it or try to push Craig's patch?
Updated by The Foreman Bot over 8 years ago
- Status changed from New to Ready For Testing
- Assignee set to Ohad Levy
- Pull request https://github.com/theforeman/foreman/pull/3769 added
Updated by Ohad Levy over 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset e86d444bd8842d01b26f87a1ed80d0f26ba4c671.
Updated by Dominic Cleal over 8 years ago
- Tracker changed from Bug to Feature
- Category changed from Web Interface to Statistics
- Translation missing: en.field_release set to 160
Updated by The Foreman Bot over 8 years ago
- Pull request https://github.com/theforeman/foreman/pull/3780 added
Updated by Ohad Levy almost 7 years ago
- Related to Bug #22515: statics chart links for hostgroup can be wrong added
Actions