Class: Stackify::Metrics::MetricAggregate
- Defined in:
- lib/stackify/metrics/metric_aggregate.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#count ⇒ Object
Returns the value of attribute count.
-
#metric_type ⇒ Object
Returns the value of attribute metric_type.
-
#monitor_id ⇒ Object
Returns the value of attribute monitor_id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#name_key ⇒ Object
Returns the value of attribute name_key.
-
#occurred_utc ⇒ Object
Returns the value of attribute occurred_utc.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #aggregate_key ⇒ Object
-
#initialize(metric) ⇒ MetricAggregate
constructor
A new instance of MetricAggregate.
Constructor Details
#initialize(metric) ⇒ MetricAggregate
Returns a new instance of MetricAggregate.
7 8 9 10 11 12 13 14 15 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 7 def initialize metric @name = metric.name @category = metric.category @metric_type = metric.metric_type @value = 0 @count = 0 @occurred_utc = metric.get_rounded_time @name_key = metric.calc_name_key end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
4 5 6 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 4 def category @category end |
#count ⇒ Object
Returns the value of attribute count.
4 5 6 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 4 def count @count end |
#metric_type ⇒ Object
Returns the value of attribute metric_type.
4 5 6 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 4 def metric_type @metric_type end |
#monitor_id ⇒ Object
Returns the value of attribute monitor_id.
4 5 6 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 4 def monitor_id @monitor_id end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 4 def name @name end |
#name_key ⇒ Object
Returns the value of attribute name_key.
4 5 6 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 4 def name_key @name_key end |
#occurred_utc ⇒ Object
Returns the value of attribute occurred_utc.
4 5 6 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 4 def occurred_utc @occurred_utc end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 4 def value @value end |
Instance Method Details
#aggregate_key ⇒ Object
17 18 19 20 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 17 def aggregate_key (@category || 'Missing Category').downcase + '-' + (@name || 'Missing Name').downcase + '-' + @metric_type.to_s + '-' + @occurred_utc.to_s end |