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.
-
#is_increment ⇒ Object
Returns the value of attribute is_increment.
-
#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.
-
#sent ⇒ Object
Returns the value of attribute sent.
-
#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 16 17 |
# 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 @sent = false @is_increment = metric.is_increment 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 |
#is_increment ⇒ Object
Returns the value of attribute is_increment.
4 5 6 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 4 def is_increment @is_increment 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 |
#sent ⇒ Object
Returns the value of attribute sent.
4 5 6 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 4 def sent @sent 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
19 20 21 22 |
# File 'lib/stackify/metrics/metric_aggregate.rb', line 19 def aggregate_key (@category || 'Missing Category').downcase + '-' + (@name || 'Missing Name').downcase + '-' + @metric_type.to_s + '-' + @occurred_utc.to_s end |