rorvswild 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rorvswild/version.rb +1 -1
- data/lib/rorvswild.rb +10 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d83c8de22b205606b6ca1d8a70edb9994361af2f
|
4
|
+
data.tar.gz: e8de8fd1f28219a40a5e525dc1d77b9ba8865542
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7c1f11d63d3ddfc0763ae333ba6978307bba99b0c8ea1774779ee822738334be82986684b3f7b043b5403db73441094e9f03c7555ec3e65c5ce3baedd7de63d
|
7
|
+
data.tar.gz: c2fb3ad205b3e98fc72c2017987d91b94c14bb4ef0a259fdf957ffc07ff8f7a9ef3fc85bfe00c782a2f8624a0d74d861dd4f91c2735775092f7e4a44a74ecdc3
|
data/lib/rorvswild/version.rb
CHANGED
data/lib/rorvswild.rb
CHANGED
@@ -66,6 +66,7 @@ module RorVsWild
|
|
66
66
|
|
67
67
|
Resque::Job.send(:extend, ResquePlugin) if defined?(Resque::Job)
|
68
68
|
Delayed::Worker.lifecycle.around(:invoke_job, &method(:around_delayed_job)) if defined?(Delayed::Worker)
|
69
|
+
Sidekiq.configure_server { |config| config.server_middleware { |chain| chain.add(SidekiqPlugin) } } if defined?(Sidekiq)
|
69
70
|
end
|
70
71
|
|
71
72
|
def before_http_request(name, start, finish, id, payload)
|
@@ -206,10 +207,10 @@ module RorVsWild
|
|
206
207
|
queries.sort { |h1, h2| h2[:runtime] <=> h1[:runtime] }[0, 25]
|
207
208
|
end
|
208
209
|
|
210
|
+
SELECT_REGEX = /\Aselect/i.freeze
|
211
|
+
|
209
212
|
def explain(sql, binds)
|
210
|
-
|
211
|
-
rows.map { |row| row["QUERY PLAN"] }.join("\n")
|
212
|
-
rescue => ex
|
213
|
+
ActiveRecord::Base.connection.explain(sql, binds) if (sql =~ SELECT_REGEX) == 0
|
213
214
|
end
|
214
215
|
|
215
216
|
def post_request(attributes)
|
@@ -307,4 +308,10 @@ module RorVsWild
|
|
307
308
|
RorVsWild.measure_block(to_s + "#perform", &block)
|
308
309
|
end
|
309
310
|
end
|
311
|
+
|
312
|
+
class SidekiqPlugin
|
313
|
+
def call(worker, item, queue, &block)
|
314
|
+
RorVsWild.measure_block(item["class"] + "#perform", &block)
|
315
|
+
end
|
316
|
+
end
|
310
317
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rorvswild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Bernard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|