protobuf-rpc-register 0.4.6 → 0.5.0

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: ae72c45b5e148728eea8842629fb32ccc8433076
4
- data.tar.gz: a026f33168a3a0c10b7bb9b1f2b8761c3009a096
3
+ metadata.gz: c588318daad4360c0740c1ba6fa29b3752979312
4
+ data.tar.gz: 587679519fc5bdf85685327ebebd4e9234bb0713
5
5
  SHA512:
6
- metadata.gz: 3262053ef1e5e3e2f2c3933156517541631d1d0b1e48d19764bcbf97a0c7a0af72cf25ea907c9006d3092325055f6453ecda2f0ad7ccb61c03a63e89dccea667
7
- data.tar.gz: d16042818414f9de0322788aff3fd5d34a67a0cda6877013e5fefa197e56423e24bd58dfa3c5e5abfff0e7e0a9649d9ea2cd2543ffd38048343883a88ab4dbbf
6
+ metadata.gz: ca4075f6e7b332164bb0f062cbac273731afd2680d6d7aad968f251092bd3619e14bed38d9f1be98788198fa8ffb3338c8c43913b7c7b4b8534a5feeba114b87
7
+ data.tar.gz: 4649b251baf0ce28c99b1abb252a79c38856a545e61fa8e481187f99b7acb5b7f83a420742e3aad27869ba80c3eafd3c5569578aafc70f006a47f2495bb097de
@@ -12,8 +12,15 @@ module Protobuf
12
12
  @port = port
13
13
  @timeout = timeout
14
14
  @namespace = namespace
15
- @logger ||= Logger.new(stdout)
16
- @error_logger ||= Logger.new(stderr)
15
+ @logger = Logger.new(stdout)
16
+ @error_logger = Logger.new(stderr)
17
+
18
+ names = self.class.name.split('::')
19
+ @service = Object.const_get([names[0..-3], 'Services', names[-1]].flatten.join('::'))
20
+ end
21
+
22
+ def internal_client
23
+ @service.client(host: host, port: port, timeout: timeout)
17
24
  end
18
25
 
19
26
  def send_rpc_request(method, msg, serializer:)
@@ -51,12 +58,6 @@ module Protobuf
51
58
 
52
59
  private
53
60
 
54
- def internal_client
55
- names = self.class.name.split('::')
56
- svc_class = [names[0..-3], 'Services', names[-1]].flatten.join('::')
57
- Object.const_get(svc_class).client(host: host, port: port, timeout: timeout)
58
- end
59
-
60
61
  def define_error_class(res)
61
62
  module_name = (@namespace || 'Protobuf').camelize
62
63
  m = Object.const_defined?(module_name, false) ? Object.const_get(module_name, false) : Object.const_set(module_name, Module.new)
@@ -1,7 +1,7 @@
1
1
  module Protobuf
2
2
  module Rpc
3
3
  module Register
4
- VERSION = "0.4.6".freeze
4
+ VERSION = "0.5.0".freeze
5
5
  end
6
6
  end
7
7
  end
@@ -1,11 +1,14 @@
1
1
  require 'protobuf'
2
2
  require 'protobuf/rpc/serializer'
3
+ require 'new_relic/agent'
3
4
 
4
5
  module Protobuf
5
6
  module Rpc
6
7
  module Services
7
8
  class Base < ::Protobuf::Rpc::Service
8
9
 
10
+ include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
11
+
9
12
  def compress_with(msg, serializer: :MSGPACK)
10
13
  if msg.is_a?(StandardError)
11
14
  msg = Messages::Error.new(error_class: msg.class.name, error_message: msg.message, error_backtrace: msg.backtrace)
@@ -58,6 +61,8 @@ module Protobuf
58
61
 
59
62
  compress_with result
60
63
  end
64
+
65
+ add_transaction_tracer method
61
66
  end
62
67
  end
63
68
  end
@@ -39,4 +39,5 @@ Gem::Specification.new do |spec|
39
39
 
40
40
  spec.add_runtime_dependency 'protobuf', '~> 3.5'
41
41
  spec.add_runtime_dependency 'active_interaction', '~> 3.0'
42
+ spec.add_runtime_dependency 'newrelic_rpm'
42
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf-rpc-register
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - scorix
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-23 00:00:00.000000000 Z
11
+ date: 2016-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '3.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: newrelic_rpm
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
167
181
  description: Register for rpc services using protobuf rpc.
168
182
  email:
169
183
  - scorix@gmail.com