rails_performance 0.0.1.18 → 0.0.1.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39436989afe127c5268d13685c11384a13051b44efdc4dac1705e671c44a0147
4
- data.tar.gz: 72988c7f770d87482c82d4699c3a2956acc4268addb22820a4093de20d1de9e8
3
+ metadata.gz: 56c91669685f1dc4c4ee8830b921acde7a98642b7065c9ffbcb939fca355abcf
4
+ data.tar.gz: 14d2bb35561e4af0a563791ae4efdae812e98235c7e692cf735346f4bd61e8f4
5
5
  SHA512:
6
- metadata.gz: 9ed81e6a440c901d68b78bda24c00340a905ac18559499f5e58f341f82961b1e3c2cfda239fbd3c286fcf4b94a61675972db1fb64e696e805df99cc8b56e2577
7
- data.tar.gz: faf3d55fb96cd5afa23c39ecc4dc0bcb76ec0caa84e9520229ead2660f8b7557bc4497b8ba5aee8c0e1342de5b3cd38ac272db70616f8ca041da1c61e0567bbc
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 !Thread.current[:in_rails_performance] && record = Thread.current["RP_request_info"]
12
- record[:status] ||= @status
13
- record[:request_id] = CurrentRequest.current.request_id
14
-
15
- # rand(500).times do |e|
16
- # finished = Time.now - rand(2000).minutes
17
- # record[:datetime] = finished.strftime(RailsPerformance::FORMAT)
18
- # record[:datetimei] = finished.to_i
19
- # record[:duration] = 50 + rand(100) + rand(50.0) + rand(e)
20
- # record[:db_runtime] = rand(50.0)
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]
@@ -1,3 +1,3 @@
1
1
  module RailsPerformance
2
- VERSION = '0.0.1.18'
2
+ VERSION = '0.0.1.19'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_performance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.18
4
+ version: 0.0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk