Class: Mnemonic::Metric::Base
- Inherits:
-
Object
- Object
- Mnemonic::Metric::Base
- Defined in:
- lib/mnemonic/metric/base.rb
Direct Known Subclasses
HashMetric::Submetric, InstancesCount, InstancesSize, RSS, Time, TimeMilliseconds, TimeSeconds
Instance Attribute Summary collapse
-
#diff ⇒ Object
readonly
Returns the value of attribute diff.
-
#diff_from_start ⇒ Object
readonly
Returns the value of attribute diff_from_start.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#prev_value ⇒ Object
readonly
Returns the value of attribute prev_value.
-
#start_value ⇒ Object
readonly
Returns the value of attribute start_value.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#diff ⇒ Object (readonly)
Returns the value of attribute diff.
6 7 8 |
# File 'lib/mnemonic/metric/base.rb', line 6 def diff @diff end |
#diff_from_start ⇒ Object (readonly)
Returns the value of attribute diff_from_start.
6 7 8 |
# File 'lib/mnemonic/metric/base.rb', line 6 def diff_from_start @diff_from_start end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/mnemonic/metric/base.rb', line 4 def name @name end |
#prev_value ⇒ Object (readonly)
Returns the value of attribute prev_value.
5 6 7 |
# File 'lib/mnemonic/metric/base.rb', line 5 def prev_value @prev_value end |
#start_value ⇒ Object (readonly)
Returns the value of attribute start_value.
5 6 7 |
# File 'lib/mnemonic/metric/base.rb', line 5 def start_value @start_value end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/mnemonic/metric/base.rb', line 5 def value @value end |
Instance Method Details
#each_submetric {|_self| ... } ⇒ Object
19 20 21 |
# File 'lib/mnemonic/metric/base.rb', line 19 def each_submetric yield self end |
#refresh! ⇒ Object
12 13 14 15 16 17 |
# File 'lib/mnemonic/metric/base.rb', line 12 def refresh! @prev_value = @value @value = current_value @diff = @value - @prev_value @diff_from_start = @value - @start_value end |
#start! ⇒ Object
8 9 10 |
# File 'lib/mnemonic/metric/base.rb', line 8 def start! @start_value = @value = current_value end |