koa-utils 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/koa-utils/slow-queries.rb +14 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49deafe13fc56672bb1a6cc41f58e3484c825106
|
4
|
+
data.tar.gz: 2263005c59963bccf4f7b865328a0e9e58dbc5ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c138a0d68dd1d2d0bd23ba78d4f11c95056c6d9edfc939f077e591ab24c8c889708fca3f387d90d38727e60760a973e4a49fac371b647c658cd5a4a635d0d3b6
|
7
|
+
data.tar.gz: 3c70823a253d6e9aa71297fe1a0f541509d69d6c220fd56681b2d5e1cc7c1c2f4ffcb8840cf9e8d2d6116cbd557b3ae9e7b1b5c20ed8db869108e6456b924341
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module KOAUtils
|
2
|
+
module SlowQuery
|
3
|
+
def self.enable_log
|
4
|
+
if Rails.env.production?
|
5
|
+
ActiveSupport::Notifications.subscribe "sql.active_record" do |name, start, finish, id, payload|
|
6
|
+
if payload[:name] == "SQL"
|
7
|
+
duration = (finish - start) * 1000
|
8
|
+
KOAUtils::Logger.measure("pg.query", duration.round.to_s+"ms")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: koa-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Rykwalder
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Gem of tools for Koala
|
15
15
|
email: eric@koa.la
|
@@ -25,6 +25,7 @@ files:
|
|
25
25
|
- lib/koa-utils/rack-request-timer.rb
|
26
26
|
- lib/koa-utils/request.rb
|
27
27
|
- lib/koa-utils/sequel-logger.rb
|
28
|
+
- lib/koa-utils/slow-queries.rb
|
28
29
|
- lib/koa-utils.rb
|
29
30
|
homepage: http://koa.la
|
30
31
|
licenses:
|
@@ -46,7 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
47
|
version: '0'
|
47
48
|
requirements: []
|
48
49
|
rubyforge_project:
|
49
|
-
rubygems_version: 2.0.
|
50
|
+
rubygems_version: 2.0.6
|
50
51
|
signing_key:
|
51
52
|
specification_version: 4
|
52
53
|
summary: KOA tools
|