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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5e9b631f4b4b68fb8a2f6f2882ee0e4259cf6151d37388b299bd55c5a0ac6c3
4
- data.tar.gz: a31ef0b50de69b81c84d5d8ec411e82db94a9aa2690fe633239e6c01f2bd2165
3
+ metadata.gz: 69d1e8d957672c105e954b64a547955e4e1c499d3d70b529e1de1b56b2fb7d51
4
+ data.tar.gz: d7f022da1ebf4ead06ebadae4ded97260276afb12cb885866d76f53e520171c8
5
5
  SHA512:
6
- metadata.gz: 4829d7292b8cc680c6936763b8fed26c5ab8f8661ada68f6c3b6a1890cee01d3ad7fb01bf377a3ce4cd3083f8b3b554d5b048c74ac594c540096724083adfb37
7
- data.tar.gz: 20798219dc410c7b2ef0096e437ba8e7d8793a3dabac2a66246a765c8db06fca195c5d05981cff4adb28c6df40456876174e5f1d2b0c292fdff4f9922a1c059a
6
+ metadata.gz: 831da45ae0c02c629fc0e1788a6b1a220872b4c449291d72df9adbfdbfada6bf0ab815fe41e5034ad5376176b6235cfcbb83d00e4688a1ba4150faedb5ed5820
7
+ data.tar.gz: 0177d93977123800440539da265fac443023d8f654f74d64ccd7c4f9a74ed2750c83c2472a7e8285b065a79589fb6024280b4767ee6df148722d34339396cb72
@@ -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
@@ -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
- AppProfiler.logger.info(
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
- AppProfiler.logger.error(
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppProfiler
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
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.2
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