Class: Hashira::Analysis::Metric
- Inherits:
-
Data
- Object
- Data
- Hashira::Analysis::Metric
- Defined in:
- lib/hashira/analysis/metric.rb
Instance Attribute Summary collapse
-
#afferent ⇒ Object
readonly
Returns the value of attribute afferent.
-
#efferent ⇒ Object
readonly
Returns the value of attribute efferent.
-
#type_count ⇒ Object
readonly
Returns the value of attribute type_count.
Instance Method Summary collapse
Instance Attribute Details
#afferent ⇒ Object (readonly)
Returns the value of attribute afferent
5 6 7 |
# File 'lib/hashira/analysis/metric.rb', line 5 def afferent @afferent end |
#efferent ⇒ Object (readonly)
Returns the value of attribute efferent
5 6 7 |
# File 'lib/hashira/analysis/metric.rb', line 5 def efferent @efferent end |
#type_count ⇒ Object (readonly)
Returns the value of attribute type_count
5 6 7 |
# File 'lib/hashira/analysis/metric.rb', line 5 def type_count @type_count end |
Instance Method Details
#instability ⇒ Object
6 7 8 9 |
# File 'lib/hashira/analysis/metric.rb', line 6 def instability total = efferent + afferent total.zero? ? 0.0 : efferent.to_f / total end |
#to_h ⇒ Object
11 |
# File 'lib/hashira/analysis/metric.rb', line 11 def to_h = { tc: type_count, ca: afferent, ce: efferent, i: instability } |