Class: Async::Container::Statistics
- Inherits:
-
Object
- Object
- Async::Container::Statistics
- Defined in:
- lib/async/container/statistics.rb
Instance Attribute Summary collapse
-
#failures ⇒ Object
readonly
Returns the value of attribute failures.
-
#restarts ⇒ Object
readonly
Returns the value of attribute restarts.
-
#spawns ⇒ Object
readonly
Returns the value of attribute spawns.
Instance Method Summary collapse
- #failure! ⇒ Object
-
#initialize ⇒ Statistics
constructor
A new instance of Statistics.
- #restart! ⇒ Object
- #spawn! ⇒ Object
Constructor Details
#initialize ⇒ Statistics
Returns a new instance of Statistics.
26 27 28 29 30 |
# File 'lib/async/container/statistics.rb', line 26 def initialize @spawns = 0 @restarts = 0 @failures = 0 end |
Instance Attribute Details
#failures ⇒ Object (readonly)
Returns the value of attribute failures.
34 35 36 |
# File 'lib/async/container/statistics.rb', line 34 def failures @failures end |
#restarts ⇒ Object (readonly)
Returns the value of attribute restarts.
33 34 35 |
# File 'lib/async/container/statistics.rb', line 33 def restarts @restarts end |
#spawns ⇒ Object (readonly)
Returns the value of attribute spawns.
32 33 34 |
# File 'lib/async/container/statistics.rb', line 32 def spawns @spawns end |
Instance Method Details
#failure! ⇒ Object
44 45 46 |
# File 'lib/async/container/statistics.rb', line 44 def failure! @failures += 1 end |
#restart! ⇒ Object
40 41 42 |
# File 'lib/async/container/statistics.rb', line 40 def restart! @restarts += 1 end |
#spawn! ⇒ Object
36 37 38 |
# File 'lib/async/container/statistics.rb', line 36 def spawn! @spawns += 1 end |