alacrity-rails 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: 6d1deb83151619090305c93c971b07df5b0d2145
4
- data.tar.gz: ba981ea6ea88638b648bfcc5a9707b32ae1b500c
3
+ metadata.gz: 99089bed3ca58c85c1eaac33c75fdd7013905424
4
+ data.tar.gz: a91b24df45b00b466b194501e8f3aa56c5daee4f
5
5
  SHA512:
6
- metadata.gz: df2ef698abaf8b5ecabd244df82f438593134f95226bea65cf109fecb2b6013ac831d81b48ffdbdc45529bb6147fc951511be5644953089d4719cd1ad3d9eee4
7
- data.tar.gz: 66861c9368055e355c1ff16239771226f05215b7af098c23c2c528efdca48e9805895df8109adce30d711ffd9603ddee639d7878c955f191e1112e9d6598990a
6
+ metadata.gz: c87cf536f88a04dde78674e2e6b0a188f6c06d1b5289cbfa4645a131e4d6ab512bd0c130bf0df5b1a39bac23e6a83f96c9c70d085c96c0587ea2395431ab71b9
7
+ data.tar.gz: 9e9d594cdf46d3199b0eb6b5b074d8a306a5c071122cc2dff5f7964b769f6c49f18a1e79496bf74394d3020483d4a728b331c3c94b648f33d242441d2ab5e8ae
@@ -6,11 +6,15 @@ module AlacrityRails
6
6
  end
7
7
 
8
8
  def self.store_request_metrics(started_at, ended_at, data)
9
- transaction.store_request_metrics(started_at, ended_at, data)
9
+ if transaction
10
+ transaction.store_request_metrics(started_at, ended_at, data)
11
+ end
10
12
  end
11
13
 
12
14
  def self.store_database_metrics(started_at, ended_at, data)
13
- transaction.store_database_metrics(started_at, ended_at, data)
15
+ if transaction
16
+ transaction.store_database_metrics(started_at, ended_at, data)
17
+ end
14
18
  end
15
19
 
16
20
  def self.close_transaction!
@@ -5,14 +5,14 @@ module AlacrityRails
5
5
  Client.log_server_startup
6
6
 
7
7
  config.middleware.insert_before 0, AlacrityRails::Middleware
8
- end
9
8
 
10
- ActiveSupport::Notifications.subscribe 'sql.active_record' do |name, started, finished, unique_id, data|
11
- AlacrityRails::Client.store_database_metrics(started, finished, data)
12
- end
9
+ ActiveSupport::Notifications.subscribe 'sql.active_record' do |name, started, finished, unique_id, data|
10
+ AlacrityRails::Client.store_database_metrics(started, finished, data)
11
+ end
13
12
 
14
- ActiveSupport::Notifications.subscribe 'process_action.action_controller' do |name, started, finished, unique_id, data|
15
- AlacrityRails::Client.store_request_metrics(started, finished, data)
13
+ ActiveSupport::Notifications.subscribe 'process_action.action_controller' do |name, started, finished, unique_id, data|
14
+ AlacrityRails::Client.store_request_metrics(started, finished, data)
15
+ end
16
16
  end
17
17
  end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module AlacrityRails
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alacrity-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alacrity, LLC