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 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Metric.
 
Methods inherited from BaseEntity
Constructor Details
#initialize(metric_hash) ⇒ Metric
Returns a new instance of Metric
      108 109 110 111 112 113 114 115 116  | 
    
      # File 'lib/hawkular/inventory/entities.rb', line 108 def initialize(metric_hash) super(metric_hash) @type = metric_hash['type']['type'] @type_path = metric_hash['type']['path'] @type_id = metric_hash['type']['id'] @unit = metric_hash['type']['unit'] @collection_interval = metric_hash['type']['collectionInterval'] @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
      106 107 108  | 
    
      # File 'lib/hawkular/inventory/entities.rb', line 106 def hawkular_metric_id @hawkular_metric_id end  | 
  
#type_id ⇒ Object (readonly)
Returns the value of attribute type_id
      104 105 106  | 
    
      # File 'lib/hawkular/inventory/entities.rb', line 104 def type_id @type_id end  |