Class: Flightdeck::QueueStats::Row
- Inherits:
-
Struct
- Object
- Struct
- Flightdeck::QueueStats::Row
- Defined in:
- app/models/flightdeck/queue_stats.rb
Instance Attribute Summary collapse
-
#completed_in_window ⇒ Object
Returns the value of attribute completed_in_window.
-
#depth ⇒ Object
Returns the value of attribute depth.
-
#name ⇒ Object
Returns the value of attribute name.
-
#oldest_ready_at ⇒ Object
Returns the value of attribute oldest_ready_at.
-
#paused_at ⇒ Object
Returns the value of attribute paused_at.
Instance Method Summary collapse
- #idle? ⇒ Boolean
-
#latency ⇒ Object
Latency only means something when something is actually waiting: an empty queue has no oldest job, and reporting "0s" would imply we measured rather than that there was nothing to measure.
- #paused? ⇒ Boolean
- #paused_for ⇒ Object
- #rate_per_hour ⇒ Object
Instance Attribute Details
#completed_in_window ⇒ Object
Returns the value of attribute completed_in_window
13 14 15 |
# File 'app/models/flightdeck/queue_stats.rb', line 13 def completed_in_window @completed_in_window end |
#depth ⇒ Object
Returns the value of attribute depth
13 14 15 |
# File 'app/models/flightdeck/queue_stats.rb', line 13 def depth @depth end |
#name ⇒ Object
Returns the value of attribute name
13 14 15 |
# File 'app/models/flightdeck/queue_stats.rb', line 13 def name @name end |
#oldest_ready_at ⇒ Object
Returns the value of attribute oldest_ready_at
13 14 15 |
# File 'app/models/flightdeck/queue_stats.rb', line 13 def oldest_ready_at @oldest_ready_at end |
#paused_at ⇒ Object
Returns the value of attribute paused_at
13 14 15 |
# File 'app/models/flightdeck/queue_stats.rb', line 13 def paused_at @paused_at end |
Instance Method Details
#idle? ⇒ Boolean
31 |
# File 'app/models/flightdeck/queue_stats.rb', line 31 def idle? = depth.zero? && completed_in_window.zero? |
#latency ⇒ Object
Latency only means something when something is actually waiting: an empty queue has no oldest job, and reporting "0s" would imply we measured rather than that there was nothing to measure.
20 21 22 23 24 |
# File 'app/models/flightdeck/queue_stats.rb', line 20 def latency return nil if depth.zero? || oldest_ready_at.nil? Time.current - oldest_ready_at end |
#paused? ⇒ Boolean
15 |
# File 'app/models/flightdeck/queue_stats.rb', line 15 def paused? = paused_at.present? |
#paused_for ⇒ Object
26 27 28 |
# File 'app/models/flightdeck/queue_stats.rb', line 26 def paused_for paused_at && Time.current - paused_at end |
#rate_per_hour ⇒ Object
30 |
# File 'app/models/flightdeck/queue_stats.rb', line 30 def rate_per_hour = completed_in_window |