Class: Dashboards::RequestTotalsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/mission_control/servers/dashboards/request_totals_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



3
4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/mission_control/servers/dashboards/request_totals_controller.rb', line 3

def show
  @project = Project.find_by(token: params[:project_id])
  @hostname = params[:hostname]
  recent_requests = @project.requests.recent_totals(@project, @hostname)
  @total_sum = recent_requests.sum(:sum_2xx).to_i +
    recent_requests.sum(:sum_3xx).to_i +
    recent_requests.sum(:sum_4xx).to_i +
    recent_requests.sum(:sum_5xx).to_i +
    recent_requests.sum(:unknown).to_i

end