rails_performance 0.0.1.18 → 0.0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/base_controller.rb +0 -5
- data/lib/rails_performance/rails/middleware.rb +10 -18
- data/lib/rails_performance/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56c91669685f1dc4c4ee8830b921acde7a98642b7065c9ffbcb939fca355abcf
|
4
|
+
data.tar.gz: 14d2bb35561e4af0a563791ae4efdae812e98235c7e692cf735346f4bd61e8f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9ab71a3a5140b1c1d403f08a6fe5c36a023b3c5839ed88b3976d0e35315364a7b335b5ec17b007b5fd2bf32067a1a7f687b6e8e356e44bd8ecd9d85af061162
|
7
|
+
data.tar.gz: 7c956c17f1e3b4b24f715331c1df68afb8ea9f2a45876a6a8bf1bd097a17982035a2de528d18a7a7ca5becd63c06a0e6edd50aa7ee2f20e129c2c5a4acaee8fd
|
@@ -1,7 +1,6 @@
|
|
1
1
|
class BaseController < ActionController::Base
|
2
2
|
layout 'rails_performance/layouts/rails_performance'
|
3
3
|
|
4
|
-
before_action :leave_finger_print
|
5
4
|
before_action :verify_access
|
6
5
|
|
7
6
|
if RailsPerformance.http_basic_authentication_enabled
|
@@ -12,10 +11,6 @@ class BaseController < ActionController::Base
|
|
12
11
|
|
13
12
|
private
|
14
13
|
|
15
|
-
def leave_finger_print
|
16
|
-
Thread.current[:in_rails_performance] = true
|
17
|
-
end
|
18
|
-
|
19
14
|
def verify_access
|
20
15
|
result = RailsPerformance.verify_access_proc.call(self)
|
21
16
|
redirect_to('/', error: 'Access Denied', status: 401) unless result
|
@@ -8,24 +8,16 @@ module RailsPerformance
|
|
8
8
|
def call(env)
|
9
9
|
@status, @headers, @response = @app.call(env)
|
10
10
|
|
11
|
-
if
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
# record[:view_runtime] = rand(50.0)
|
22
|
-
# RP::Utils.log_request_in_redis(record)
|
23
|
-
# end
|
24
|
-
|
25
|
-
RP::Utils.log_trace_in_redis(CurrentRequest.current.request_id, CurrentRequest.current.storage)
|
26
|
-
RP::Utils.log_request_in_redis(record)
|
27
|
-
Thread.current["RP_request_info"] = nil
|
28
|
-
CurrentRequest.cleanup
|
11
|
+
if record = Thread.current["RP_request_info"]
|
12
|
+
begin
|
13
|
+
record[:status] ||= @status
|
14
|
+
record[:request_id] = CurrentRequest.current.request_id
|
15
|
+
RP::Utils.log_trace_in_redis(CurrentRequest.current.request_id, CurrentRequest.current.storage)
|
16
|
+
RP::Utils.log_request_in_redis(record)
|
17
|
+
ensure
|
18
|
+
Thread.current["RP_request_info"] = nil
|
19
|
+
CurrentRequest.cleanup
|
20
|
+
end
|
29
21
|
end
|
30
22
|
|
31
23
|
[@status, @headers, @response]
|