Class: Stackify::Metrics::LatestAggregate

Inherits:
Object
  • Object
show all
Defined in:
lib/stackify/metrics/metric_aggregate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(aggr_metric) ⇒ LatestAggregate

Returns a new instance of LatestAggregate.



30
31
32
33
34
35
36
37
38
39
# File 'lib/stackify/metrics/metric_aggregate.rb', line 30

def initialize aggr_metric
  @count = aggr_metric.count
  @metric_type = aggr_metric.metric_type
  @metric_id = aggr_metric.monitor_id
  @name = aggr_metric.name
  @occurred_utc = aggr_metric.occurred_utc
  @value = aggr_metric.value
  @count = aggr_metric.count
  @category = aggr_metric.category
end

Instance Attribute Details

#categoryObject

Returns the value of attribute category.



27
28
29
# File 'lib/stackify/metrics/metric_aggregate.rb', line 27

def category
  @category
end

#countObject

Returns the value of attribute count.



27
28
29
# File 'lib/stackify/metrics/metric_aggregate.rb', line 27

def count
  @count
end

#metric_idObject

Returns the value of attribute metric_id.



27
28
29
# File 'lib/stackify/metrics/metric_aggregate.rb', line 27

def metric_id
  @metric_id
end

#metric_typeObject

Returns the value of attribute metric_type.



27
28
29
# File 'lib/stackify/metrics/metric_aggregate.rb', line 27

def metric_type
  @metric_type
end

#nameObject

Returns the value of attribute name.



27
28
29
# File 'lib/stackify/metrics/metric_aggregate.rb', line 27

def name
  @name
end

#occurred_utcObject

Returns the value of attribute occurred_utc.



27
28
29
# File 'lib/stackify/metrics/metric_aggregate.rb', line 27

def occurred_utc
  @occurred_utc
end

#valueObject

Returns the value of attribute value.



27
28
29
# File 'lib/stackify/metrics/metric_aggregate.rb', line 27

def value
  @value
end

Instance Method Details

#to_hObject



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/stackify/metrics/metric_aggregate.rb', line 41

def to_h
  {
    'MetricType' => @metric_type,
    'MetricID' => @metric_id,
    'Name' => @name,
    'OccurredUtc' => @occurred_utc,
    'Value' => @value,
    'Count' => @count,
    'Category' => @category
  }
end