Class: RailsObservatory::JobsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/rails_observatory/jobs_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#duration, #set_duration

Instance Method Details

#indexObject



8
9
10
11
# File 'app/controllers/rails_observatory/jobs_controller.rb', line 8

def index
  JobTrace.ensure_index
  @recent_jobs = JobTrace.all.take(10)
end

#set_time_rangeObject



19
20
21
22
23
# File 'app/controllers/rails_observatory/jobs_controller.rb', line 19

def set_time_range
  TimeSeries.with_slice(duration.seconds.ago..) do
    yield
  end
end

#showObject



13
14
15
16
17
# File 'app/controllers/rails_observatory/jobs_controller.rb', line 13

def show
  @job = JobTrace.find(params[:id])
  @events = @job.events

end