Module: ESP::StatTotals
- Included in:
- Stat, StatCustomSignature, StatRegion, StatService, StatSignature
- Defined in:
- lib/esp/resources/concerns/stat_totals.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#destroy ⇒ Object
Not Implemented.
-
#save ⇒ Object
Not Implemented.
-
#total ⇒ Object
We only add new_1w* and old* fields as the new_1w field includes the counts from new_1h and new_1d.
- #total_suppressed ⇒ Object
Instance Method Details
#destroy ⇒ Object
Not Implemented. You cannot delete a Stat.
8 9 10 |
# File 'lib/esp/resources/concerns/stat_totals.rb', line 8 def destroy fail ESP::NotImplementedError end |
#save ⇒ Object
Not Implemented. You cannot create or update a Stat.
3 4 5 |
# File 'lib/esp/resources/concerns/stat_totals.rb', line 3 def save fail ESP::NotImplementedError end |
#total ⇒ Object
We only add new_1w* and old* fields as the new_1w field includes the counts from new_1h and new_1d.
13 14 15 |
# File 'lib/esp/resources/concerns/stat_totals.rb', line 13 def total attributes.select { |a, _v| a.match(/new_1w|old/) }.values.reduce(:+) end |
#total_suppressed ⇒ Object
17 18 19 |
# File 'lib/esp/resources/concerns/stat_totals.rb', line 17 def total_suppressed attributes.select { |a, _v| a.match(/suppressed_/) }.values.reduce(:+) end |