Class: RoundhouseUi::BusyController

Inherits:
ApplicationController show all
Defined in:
app/controllers/roundhouse_ui/busy_controller.rb

Overview

What's executing right now, via the backend port — the live in-flight jobs Sidekiq Web calls "Busy". Surfaces long-running (possibly hung) jobs, which the stock UI makes you eyeball.

Constant Summary collapse

LONG_RUNNING =

seconds

60

Constants inherited from ApplicationController

ApplicationController::AUDIT_VERBS

Instance Method Summary collapse

Methods inherited from ApplicationController

allow_in_read_only, guard_in_read_only, #redirect_to, requires_capability

Instance Method Details

#cancelObject



20
21
22
23
# File 'app/controllers/roundhouse_ui/busy_controller.rb', line 20

def cancel
  RoundhouseUi::Cancellation.cancel!(params[:jid])
  redirect_to busy_path, notice: "Cancellation requested for #{params[:jid]}."
end

#indexObject



10
11
12
13
14
15
16
17
18
# File 'app/controllers/roundhouse_ui/busy_controller.rb', line 10

def index
  @threshold = LONG_RUNNING
  @work = backend.busy
  # "4m 12s" means nothing on its own — fine for a nightly rollup, a hang for
  # a webhook. DurationCollector already records the average per class, so
  # where it is enabled the page can say "×8 typical" instead. Empty
  # otherwise, and the view degrades to elapsed with no ceiling.
  @typical = typical_durations
end