Skip to content

Commit

Permalink
Merge pull request #15194 from isimluk/supports-metrics
Browse files Browse the repository at this point in the history
Introduce: supports :capture
  • Loading branch information
agrare authored Jun 7, 2017
2 parents 6371064 + ec19fba commit e697fec
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/container_service.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class ContainerService < ApplicationRecord
include CustomAttributeMixin
include SupportsFeatureMixin
# :name, :uid, :creation_timestamp, :resource_version, :namespace
# :labels, :selector, :protocol, :port, :container_port, :portal_ip, :session_affinity

Expand Down
6 changes: 6 additions & 0 deletions app/models/metric/ci_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ module Metric::CiMixin
Metric::LongTermAverages::AVG_METHODS_WITHOUT_OVERHEAD.each do |vcol|
virtual_column vcol, :type => :float, :uses => :vim_performance_operating_ranges
end

supports :capture do
unless self.class.parent::MetricsCapture.instance_methods.include?(:perf_collect_metrics)
unsupported_reason_add(:metrics, _('This provider does not support metrics collection'))
end
end
end

def has_perf_data?
Expand Down
1 change: 1 addition & 0 deletions app/models/miq_enterprise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class MiqEnterprise < ApplicationRecord

acts_as_miq_taggable

include SupportsFeatureMixin
include AggregationMixin

include MiqPolicyMixin
Expand Down
1 change: 1 addition & 0 deletions app/models/miq_region.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class MiqRegion < ApplicationRecord
include ConfigurationManagementMixin

include MiqPolicyMixin
include SupportsFeatureMixin
include Metric::CiMixin

alias_method :all_storages, :storages
Expand Down
1 change: 1 addition & 0 deletions app/models/mixins/supports_feature_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ module SupportsFeatureMixin
:launch_cockpit => 'Launch Cockpit UI',
:live_migrate => 'Live Migration',
:migrate => 'Migration',
:capture => 'Capture of Capacity & Utilization Metrics',
:provisioning => 'Provisioning',
:publish => 'Publishing',
:quick_stats => 'Quick Stats',
Expand Down
2 changes: 1 addition & 1 deletion app/models/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class Storage < ApplicationRecord

include SerializedEmsRefObjMixin
include FilterableMixin
include SupportsFeatureMixin
include Metric::CiMixin
include StorageMixin
include AsyncDeleteMixin
include AvailabilityMixin
include SupportsFeatureMixin
include TenantIdentityMixin

virtual_column :v_used_space, :type => :integer
Expand Down
1 change: 1 addition & 0 deletions app/models/zone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Zone < ApplicationRecord

include AuthenticationMixin

include SupportsFeatureMixin
include Metric::CiMixin
include AggregationMixin
include ConfigurationManagementMixin
Expand Down

0 comments on commit e697fec

Please sign in to comment.