Class: RoundhouseUi::Day
- Inherits:
-
Struct
- Object
- Struct
- RoundhouseUi::Day
- Defined in:
- lib/roundhouse_ui/history.rb
Overview
Daily processed and failed counts, for the one question every other number on the dashboard cannot answer: is this normal?
30,655 failures is alarming or unremarkable depending on the day, and a live throughput chart that starts empty on every page load cannot tell you which.
Sidekiq already records this — Sidekiq::Stats::History keeps a counter per
day and Roundhouse ignored it entirely. So this needs no storage of its own,
no migration, and it works on every Sidekiq install. See #61.
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#failed ⇒ Object
Returns the value of attribute failed.
-
#processed ⇒ Object
Returns the value of attribute processed.
Instance Method Summary collapse
-
#failure_rate ⇒ Object
Share of the day's work that failed.
- #quiet? ⇒ Boolean
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date
11 12 13 |
# File 'lib/roundhouse_ui/history.rb', line 11 def date @date end |
#failed ⇒ Object
Returns the value of attribute failed
11 12 13 |
# File 'lib/roundhouse_ui/history.rb', line 11 def failed @failed end |
#processed ⇒ Object
Returns the value of attribute processed
11 12 13 |
# File 'lib/roundhouse_ui/history.rb', line 11 def processed @processed end |
Instance Method Details
#failure_rate ⇒ Object
Share of the day's work that failed. The line worth drawing: counts move with traffic, so a busy Monday looks worse than a quiet Sunday even when nothing changed. A rate does not.
15 16 17 18 19 20 |
# File 'lib/roundhouse_ui/history.rb', line 15 def failure_rate total = processed.to_i + failed.to_i return 0.0 if total.zero? failed.to_i / total.to_f end |
#quiet? ⇒ Boolean
22 |
# File 'lib/roundhouse_ui/history.rb', line 22 def quiet? = processed.to_i.zero? && failed.to_i.zero? |