Module: Cosmo::API::Stats
- Defined in:
- lib/cosmo/api/stats.rb,
sig/cosmo/api/stats.rbs
Class Method Summary collapse
- .busy ⇒ ::Integer
- .dead ⇒ ::Integer
- .enqueued ⇒ ::Integer
- .failed ⇒ ::Integer
- .processed ⇒ ::Integer
- .retries ⇒ ::Integer
- .scheduled ⇒ ::Integer
- .summary ⇒ Hash[Symbol, ::Integer]
Class Method Details
.dead ⇒ ::Integer
39 40 41 |
# File 'lib/cosmo/api/stats.rb', line 39 def dead Stream.new("dead").size end |
.enqueued ⇒ ::Integer
27 28 29 |
# File 'lib/cosmo/api/stats.rb', line 27 def enqueued Stream.jobs.sum(&:size) end |
.failed ⇒ ::Integer
19 20 21 |
# File 'lib/cosmo/api/stats.rb', line 19 def failed Counter.instance.get(:failed) end |
.processed ⇒ ::Integer
15 16 17 |
# File 'lib/cosmo/api/stats.rb', line 15 def processed Counter.instance.get(:processed) end |
.retries ⇒ ::Integer
31 32 33 |
# File 'lib/cosmo/api/stats.rb', line 31 def retries Stream.jobs.sum(&:retries) end |
.scheduled ⇒ ::Integer
35 36 37 |
# File 'lib/cosmo/api/stats.rb', line 35 def scheduled Stream.new("scheduled").size end |
.summary ⇒ Hash[Symbol, ::Integer]
11 12 13 |
# File 'lib/cosmo/api/stats.rb', line 11 def summary { processed:, failed:, busy:, enqueued:, retries:, scheduled:, dead: } end |