Class: Api::StatisticsController

Inherits:
ApiController show all
Defined in:
app/controllers/api/statistics_controller.rb

Instance Method Summary collapse

Methods inherited from ApiController

#probe

Instance Method Details

#showObject

Show statistics for a given period

Parameters:

period

The period to calculate the statistics for. Possible values are:

today, yesterday, week, month,all. Default is today.

Example:

$ curl http://localhost:3000/api/statistics?period=week

{
  number_of_failed_jobs: 0
  average_processing_time: 8.244175910949707
  number_of_completed_jobs: 1
  average_queue_time: 1
  number_of_processing_jobs: 0
  seconds_encoded: 18
}

23
24
25
# File 'app/controllers/api/statistics_controller.rb', line 23

def show
  respond_with History.new(params[:period])
end