Class: SagaForge::Dashboard::StatsQuery
- Inherits:
-
Object
- Object
- SagaForge::Dashboard::StatsQuery
- Defined in:
- app/queries/saga_forge/dashboard/stats_query.rb
Constant Summary collapse
- CAP =
5000
Instance Method Summary collapse
- #counts ⇒ Object
-
#initialize(saga_class:) ⇒ StatsQuery
constructor
A new instance of StatsQuery.
- #label(n) ⇒ Object
Constructor Details
#initialize(saga_class:) ⇒ StatsQuery
Returns a new instance of StatsQuery.
6 7 8 |
# File 'app/queries/saga_forge/dashboard/stats_query.rb', line 6 def initialize(saga_class:) @saga_class = saga_class end |
Instance Method Details
#counts ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/queries/saga_forge/dashboard/stats_query.rb', line 10 def counts base = SagaForge::State.for_saga(@saga_class) { all: capped(base), stalled: capped(base.stalled), suspended: capped(base.suspended), compensating: capped(base.compensating), finalized: capped(base.finalized), active: capped(base.active) } end |