Class: Hawkular::Inventory::Metric
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- Hawkular::Inventory::Metric
- Includes:
- MetricFields
- Defined in:
- lib/hawkular/inventory/entities.rb
Overview
Definition of a Metric inside the inventory.
Instance Attribute Summary collapse
-
#hawkular_metric_id ⇒ String
readonly
Metric id used in Hawkular Metrics.
-
#type_id ⇒ Object
readonly
Returns the value of attribute type_id.
Attributes included from MetricFields
#collection_interval, #type, #unit
Attributes inherited from BaseEntity
#env, #feed, #id, #name, #path, #properties
Instance Method Summary collapse
-
#initialize(metric_hash, metric_type) ⇒ Metric
constructor
A new instance of Metric.
Methods inherited from BaseEntity
Constructor Details
#initialize(metric_hash, metric_type) ⇒ Metric
Returns a new instance of Metric
110 111 112 113 114 115 116 117 118 |
# File 'lib/hawkular/inventory/entities.rb', line 110 def initialize(metric_hash, metric_type) super(metric_hash) @type = metric_type.type @type_path = metric_hash['metricTypePath'] @type_id = metric_type.id @unit = metric_type.unit @collection_interval = metric_hash['collectionInterval'] || metric_type.collection_interval @hawkular_metric_id = @properties.key?('hawkular-metric-id') ? @properties['hawkular-metric-id'] : @id end |
Instance Attribute Details
#hawkular_metric_id ⇒ String (readonly)
Returns metric id used in Hawkular Metrics
108 109 110 |
# File 'lib/hawkular/inventory/entities.rb', line 108 def hawkular_metric_id @hawkular_metric_id end |
#type_id ⇒ Object (readonly)
Returns the value of attribute type_id
106 107 108 |
# File 'lib/hawkular/inventory/entities.rb', line 106 def type_id @type_id end |