Skip to content

Commit

Permalink
Add option for container performance reports
Browse files Browse the repository at this point in the history
  • Loading branch information
Ari Zellner committed Dec 22, 2016
1 parent 8eb9aee commit fac3f3c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/container_group_performance.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ContainerGroupPerformance < MetricRollup
default_scope { where "resource_type = 'ContainerGroup' and resource_id IS NOT NULL" }

belongs_to :container_group, :foreign_key => :resource_id, :class_name => ContainerGroup.name
end
5 changes: 5 additions & 0 deletions app/models/container_node_performance.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ContainerNodePerformance < MetricRollup
default_scope { where "resource_type = 'ContainerNode' and resource_id IS NOT NULL" }

belongs_to :container_node, :foreign_key => :resource_id, :class_name => ContainerNode.name
end
5 changes: 5 additions & 0 deletions app/models/container_performance.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ContainerPerformance < MetricRollup
default_scope { where "resource_type = 'Container' and resource_id IS NOT NULL" }

belongs_to :container_node, :foreign_key => :resource_id, :class_name => Container.name
end
5 changes: 5 additions & 0 deletions app/models/container_project_performance.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ContainerProjectPerformance < MetricRollup
default_scope { where "resource_type = 'ContainerProject' and resource_id IS NOT NULL" }

belongs_to :container_node, :foreign_key => :resource_id, :class_name => ContainerProject.name
end
6 changes: 6 additions & 0 deletions lib/miq_expression.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ class MiqExpression
ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem
ManageIQ::Providers::ConfigurationManager
Container
ContainerPerformance
ContainerGroup
ContainerGroupPerformance
ContainerImage
ContainerImageRegistry
ContainerNode
ContainerNodePerformance
ContainerProject
ContainerProjectPerformance
ContainerReplicator
ContainerRoute
ContainerService
Expand Down Expand Up @@ -1292,6 +1296,8 @@ def self.get_column_details(column_names, class_path, assoc_path, opts)
next(c) if includes.include?(c)
c if includes.detect { |incl| c.match(incl) }
end.compact
when base_model.starts_with?("Container")
excludes += ["^.*derived_host_count_off$", "^.*derived_host_count_on$", "^.*derived_vm_count_off$", "^.*derived_vm_count_on$", "^.*derived_storage.*$"]
end

column_names.collect do|c|
Expand Down
4 changes: 4 additions & 0 deletions locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -700,11 +700,15 @@ en:
CustomButton: Button
CustomButtonSet: Buttons Group
Container: Container
ContainerPerformance: Performance - Container
ContainerGroup: Pod
ContainerGroupPerformance: Performance - Pod
ContainerImageRegistry: Image Registry
ContainerImage: Container Image
ContainerNode: Node
ContainerNodePerformance: Performance - ContainerNode
ContainerProject: Project
ContainerProjectPerformance: Performance - ContainerProject
ContainerRoute: Route
ContainerReplicator: Replicator
ContainerService: Container Service
Expand Down

0 comments on commit fac3f3c

Please sign in to comment.