app_profiler 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/app_profiler/railtie.rb +2 -2
- data/lib/app_profiler/server.rb +6 -5
- data/lib/app_profiler/version.rb +1 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69d1e8d957672c105e954b64a547955e4e1c499d3d70b529e1de1b56b2fb7d51
|
4
|
+
data.tar.gz: d7f022da1ebf4ead06ebadae4ded97260276afb12cb885866d76f53e520171c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 831da45ae0c02c629fc0e1788a6b1a220872b4c449291d72df9adbfdbfada6bf0ab815fe41e5034ad5376176b6235cfcbb83d00e4688a1ba4150faedb5ed5820
|
7
|
+
data.tar.gz: 0177d93977123800440539da265fac443023d8f654f74d64ccd7c4f9a74ed2750c83c2472a7e8285b065a79589fb6024280b4767ee6df148722d34339396cb72
|
data/lib/app_profiler/railtie.rb
CHANGED
@@ -46,9 +46,9 @@ module AppProfiler
|
|
46
46
|
|
47
47
|
initializer "app_profiler.enable_server" do
|
48
48
|
if AppProfiler.server.enabled
|
49
|
-
AppProfiler::Server.start
|
49
|
+
AppProfiler::Server.start(AppProfiler.logger)
|
50
50
|
ActiveSupport::ForkTracker.after_fork do
|
51
|
-
AppProfiler::Server.start
|
51
|
+
AppProfiler::Server.start(AppProfiler.logger)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
data/lib/app_profiler/server.rb
CHANGED
@@ -230,7 +230,8 @@ module AppProfiler
|
|
230
230
|
end
|
231
231
|
end
|
232
232
|
|
233
|
-
def initialize(transport)
|
233
|
+
def initialize(transport, logger)
|
234
|
+
@logger = logger
|
234
235
|
case transport
|
235
236
|
when TRANSPORT_UNIX
|
236
237
|
@transport = ProfileServer::UNIX.new
|
@@ -242,7 +243,7 @@ module AppProfiler
|
|
242
243
|
|
243
244
|
@listen_thread = nil
|
244
245
|
|
245
|
-
|
246
|
+
@logger.info(
|
246
247
|
"[AppProfiler::Server] listening on addr=#{@transport.socket.addr}"
|
247
248
|
)
|
248
249
|
@pid = Process.pid
|
@@ -293,7 +294,7 @@ module AppProfiler
|
|
293
294
|
session.print(part)
|
294
295
|
end
|
295
296
|
rescue => e
|
296
|
-
|
297
|
+
@logger.error(
|
297
298
|
"[AppProfiler::Server] exception #{e} responding to request #{request}: #{e.message}"
|
298
299
|
)
|
299
300
|
ensure
|
@@ -323,10 +324,10 @@ module AppProfiler
|
|
323
324
|
end
|
324
325
|
end
|
325
326
|
|
326
|
-
def start
|
327
|
+
def start(logger = Logger.new(IO::NULL))
|
327
328
|
return if profile_server
|
328
329
|
|
329
|
-
profile_servers[Process.pid] = ProfileServer.new(AppProfiler::Server.transport)
|
330
|
+
profile_servers[Process.pid] = ProfileServer.new(AppProfiler::Server.transport, logger)
|
330
331
|
profile_server.serve
|
331
332
|
profile_server
|
332
333
|
end
|
data/lib/app_profiler/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gannon McGibbon
|
@@ -43,20 +43,6 @@ dependencies:
|
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: railties
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
requirements:
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: '5.2'
|
53
|
-
type: :runtime
|
54
|
-
prerelease: false
|
55
|
-
version_requirements: !ruby/object:Gem::Requirement
|
56
|
-
requirements:
|
57
|
-
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '5.2'
|
60
46
|
- !ruby/object:Gem::Dependency
|
61
47
|
name: stackprof
|
62
48
|
requirement: !ruby/object:Gem::Requirement
|