logjam_agent 0.19.3 → 0.19.4

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
  SHA1:
3
- metadata.gz: 1634e5c22844025d52a1a2e26e95ed219cc935b5
4
- data.tar.gz: 9612717c779312008965b7401e7f13f241b7c710
3
+ metadata.gz: 4bffe54ae7a2f79b516804c95ecf2a2272d3b1b7
4
+ data.tar.gz: 280a394d54ecf5d7fcb84dd78c15222746b77d2a
5
5
  SHA512:
6
- metadata.gz: f9abd9d795fa18d84f0baa1142967922e44f130cf607ac4b63f23ccd2e81c570455d5e40b21d98ffa54b396ba44a6baddf2d803f24cea4dab9eb2128da192a90
7
- data.tar.gz: 1d6d570cfc85e36356cf8b62ef94be560e6319aea29d00ea947641e0ea5829f50aebdd6a0e530deee296a08d165a54b335aee32078aa4578a536f18007b7e737
6
+ metadata.gz: 00581356bef24ce775b29f9a201f2635909fb0fd36f73c9f0db2a741d40b3224d8557c2a7d57c17f964e4cffd2c213d78fa2c3a484fccdc4a5650cab6988362b
7
+ data.tar.gz: be04344959f08f5ee808e12f0c8450984e2d02f7ffddef88ba62c65f8c1b38fa63d74aa2b9fcd73e1cb3fcffd08de3212daebc64a81266392d7b270bb2efcab6
@@ -72,6 +72,9 @@ module LogjamAgent
72
72
 
73
73
  LogjamAgent.application_revision = `git rev-parse HEAD 2>/dev/null`.chomp rescue ""
74
74
 
75
+ # disable logjam request forwarding by default in test environment
76
+ LogjamAgent.disable! if Rails.env.test?
77
+
75
78
  # patch controller testing to create a logjam request, because middlewares aren't executed
76
79
  if Rails.env.test?
77
80
  ActiveSupport.on_load(:action_controller) do
@@ -1,3 +1,3 @@
1
1
  module LogjamAgent
2
- VERSION = "0.19.3"
2
+ VERSION = "0.19.4"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  module LogjamAgent
2
2
  class ZMQForwarder
3
- attr_reader :app, :env
3
+ attr_reader :app, :env, :connection_specs
4
4
 
5
5
  include Util
6
6
 
@@ -10,24 +10,21 @@ module LogjamAgent
10
10
  @env = args[1] || LogjamAgent.environment_name
11
11
  @app_env = "#{@app}-#{@env}"
12
12
  @config = default_options.merge!(opts)
13
+ @config[:host] = "localhost" if @config[:host].blank?
14
+ @connection_specs = @config[:host].split(',').map do |host|
15
+ augment_connection_spec(host, @config[:port])
16
+ end
13
17
  @sequence = 0
14
18
  end
15
19
 
16
20
  def default_options
17
21
  {
18
- :host => "localhost",
19
22
  :port => 9605,
20
23
  :linger => 100,
21
24
  :snd_hwm => 100,
22
25
  }
23
26
  end
24
27
 
25
- def connection_specs
26
- @connection_specs ||= @config[:host].split(',').map do |host|
27
- augment_connection_spec(host, @config[:port])
28
- end
29
- end
30
-
31
28
  @@mutex = Mutex.new
32
29
  @@zmq_context = nil
33
30
 
@@ -44,17 +41,15 @@ module LogjamAgent
44
41
  end
45
42
 
46
43
  def socket
47
- @socket ||=
48
- begin
49
- socket = self.class.context.socket(ZMQ::PUSH)
50
- socket.setsockopt(ZMQ::LINGER, @config[:linger])
51
- socket.setsockopt(ZMQ::SNDHWM, @config[:snd_hwm])
52
- connection_specs.each do |spec|
53
- socket.connect(spec)
54
- end
55
- at_exit { reset }
56
- socket
57
- end
44
+ return @socket if @socket
45
+ @socket = self.class.context.socket(ZMQ::PUSH)
46
+ at_exit { reset }
47
+ @socket.setsockopt(ZMQ::LINGER, @config[:linger])
48
+ @socket.setsockopt(ZMQ::SNDHWM, @config[:snd_hwm])
49
+ @connection_specs.each do |spec|
50
+ @socket.connect(spec)
51
+ end
52
+ @socket
58
53
  end
59
54
 
60
55
  def reset
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logjam_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.3
4
+ version: 0.19.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes