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 +4 -4
- data/lib/alacrity-rails/client.rb +6 -2
- data/lib/alacrity-rails/railtie.rb +6 -6
- data/lib/alacrity-rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99089bed3ca58c85c1eaac33c75fdd7013905424
|
4
|
+
data.tar.gz: a91b24df45b00b466b194501e8f3aa56c5daee4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
-
|
11
|
-
|
12
|
-
|
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
|
-
|
15
|
-
|
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
|