a_r_q_logger 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/a_r_q_logger.rb +6 -7
- data/lib/a_r_q_logger/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: 6114759f2f64fb1e746e8a923e7e44c0a27ed7bd
|
4
|
+
data.tar.gz: a2ddaeec362030948e7a4e6af3319b180afe761a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b5e549c08d77ffeec395f6740bfbbd655d339a3678d27a8a006eb575bb5e9defa1a532c56e8899e2fdfe8cc4917fdbb0c35e83ea712db9d9ef1f96f44974724
|
7
|
+
data.tar.gz: 9e81078f265d2a3408d85c8c481ae8adbbab5bc38a4f510c0f9fbc3f2e1570cfa4686d26cb0a985f316c9f1b6ec41c2f06cf27fee6ac080053184a5c63eb089d
|
data/Gemfile.lock
CHANGED
data/lib/a_r_q_logger.rb
CHANGED
@@ -13,15 +13,14 @@ module ARQLogger
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def finish
|
16
|
+
logged = ActiveRecord::LogSubscriber.duration_store_box
|
17
|
+
ActiveRecord::LogSubscriber.duration_store_box = nil
|
18
|
+
|
16
19
|
Result.new(
|
17
|
-
count:
|
18
|
-
msec:
|
20
|
+
count: logged.size,
|
21
|
+
msec: logged.sum.round(1)
|
19
22
|
)
|
20
23
|
end
|
21
|
-
|
22
|
-
def logger
|
23
|
-
ActiveRecord::LogSubscriber.duration_store_box
|
24
|
-
end
|
25
24
|
end
|
26
25
|
|
27
26
|
class Result < Struct.new(:count, :msec)
|
@@ -41,7 +40,7 @@ class ARQLoggerApplicationProxy < ::Rails::Railtie
|
|
41
40
|
def sql(event)
|
42
41
|
payload = event.payload
|
43
42
|
if payload[:name] && !IGNORE_PAYLOAD_NAMES.include?(payload[:name])
|
44
|
-
self.class.duration_store_box.push(event.duration)
|
43
|
+
self.class.duration_store_box.push(event.duration) if self.class.duration_store_box
|
45
44
|
end
|
46
45
|
real_sql(event)
|
47
46
|
end
|
data/lib/a_r_q_logger/version.rb
CHANGED