4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'app/controllers/concerns/response_range_concern.rb', line 4
def setup_duration_range(type = :route)
ransack_params = params[:q] || {}
thresholds = RailsPulse.configuration.public_send("#{type}_thresholds")
if ransack_params[:duration].present?
selected_range = ransack_params[:duration]
start_duration =
case ransack_params[:duration].to_sym
when :slow then thresholds[:slow]
when :very_slow then thresholds[:very_slow]
when :critical then thresholds[:critical]
else 0
end
else
start_duration = 0
selected_range = :all
end
[ start_duration, selected_range ]
end
|