rookout 0.1.42 → 0.1.44
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rookout/augs/aug_factory.rb +3 -1
- data/lib/rookout/augs/locations/location.rb +1 -1
- data/lib/rookout/com_ws/agent_com_ws.rb +2 -4
- data/lib/rookout/com_ws/envelope_wrapper.rb +3 -1
- data/lib/rookout/commit.rb +1 -1
- data/lib/rookout/config.rb +3 -1
- data/lib/rookout/exceptions.rb +1 -1
- data/lib/rookout/interface.rb +1 -0
- data/lib/rookout/processor/namespaces/ruby_object_namespace.rb +12 -12
- data/lib/rookout/utils.rb +27 -19
- data/lib/rookout/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0233712f50c0fe5e94c8288b73ee96a07da9bb1692cc553ac83692a10655c131
|
4
|
+
data.tar.gz: b273a8cc02ed25508400b58758c5706f6073a979c7d323316c9957dd4f186d30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afbacca6a3828ebb0e2bda728c072a9515fa6f3003945a9ab5bf972bde564a77dc950224d14bbc58b90aebdef3f505c90b89baf8d916beaca9c3bac3215fdb98
|
7
|
+
data.tar.gz: bf5c468000ed3dd7e2def2d628acab6540226ade8364a77036a12421ade338ed0106123f4c19cbc9e81c988e624bf50e9e84aa3dec090a17e68c41014390dc06
|
@@ -107,7 +107,9 @@ module Rookout
|
|
107
107
|
|
108
108
|
unless config.nil? || config.empty?
|
109
109
|
rate_limit_split = config.split "/"
|
110
|
-
unless rate_limit_split.length == 2 &&
|
110
|
+
unless rate_limit_split.length == 2 && \
|
111
|
+
Utils.is_number?(rate_limit_split[0]) && \
|
112
|
+
Utils.is_number?(rate_limit_split[1])
|
111
113
|
raise Exceptions::RookInvalidRateLimitConfiguration, config
|
112
114
|
end
|
113
115
|
|
@@ -105,7 +105,6 @@ module Rookout
|
|
105
105
|
|
106
106
|
private
|
107
107
|
|
108
|
-
# rubocop:disable Style/StderrPuts
|
109
108
|
def connection_thread
|
110
109
|
backoff = Backoff.new
|
111
110
|
|
@@ -115,7 +114,8 @@ module Rookout
|
|
115
114
|
|
116
115
|
if @print_on_initial_connection
|
117
116
|
@print_on_initial_connection = false
|
118
|
-
|
117
|
+
Utils.quiet_puts "[Rookout] Successfully connected to controller"
|
118
|
+
Utils.quiet_puts "[Rookout] Rook's ID is #{@agent_id}"
|
119
119
|
end
|
120
120
|
Logger.instance.debug "WebSocket connected successfully"
|
121
121
|
Logger.instance.info "Finished initialization"
|
@@ -139,13 +139,11 @@ module Rookout
|
|
139
139
|
rescue Exception => e
|
140
140
|
Logger.instance.error "Unexpected error in connection_thread", e
|
141
141
|
end
|
142
|
-
# rubocop:enable Style/StderrPuts
|
143
142
|
|
144
143
|
def open_new_connection
|
145
144
|
client = WebsocketClient.new @uri, @proxy, @token
|
146
145
|
client.connect
|
147
146
|
|
148
|
-
Logger.instance.info "Registering agent with id #{@agent_id}"
|
149
147
|
msg = Com::Rookout::NewAgentMessage.new agent_info: @info.pack
|
150
148
|
client.send_frame wrap_in_envelope(msg)
|
151
149
|
|
@@ -29,7 +29,9 @@ class Variant2EnvelopeWrapper < EnvelopeWrapperBase
|
|
29
29
|
report_id: report_id
|
30
30
|
@serializer = Rookout::Processor::NamespaceSerializer2.new
|
31
31
|
@aug_report_message.arguments2 = @serializer.dump arguments, true
|
32
|
-
@serializer.string_cache.each
|
32
|
+
@serializer.string_cache.each do |key, value|
|
33
|
+
@aug_report_message.strings_cache[key.encode "UTF-8", invalid: :replace, undef: :replace, replace: "?"] = value
|
34
|
+
end
|
33
35
|
@envelope = wrap_in_envelope @aug_report_message
|
34
36
|
@aug_report_message = nil
|
35
37
|
end
|
data/lib/rookout/commit.rb
CHANGED
data/lib/rookout/config.rb
CHANGED
@@ -6,8 +6,10 @@ module Rookout
|
|
6
6
|
# Magic to allow for module variables to be easily accessible
|
7
7
|
class << self
|
8
8
|
attr_accessor :debug
|
9
|
+
attr_accessor :quiet
|
9
10
|
|
10
11
|
Rookout::Config.debug = false
|
12
|
+
Rookout::Config.quiet = false
|
11
13
|
|
12
14
|
attr_accessor :logger_filename
|
13
15
|
attr_accessor :logger_log_to_stderr
|
@@ -112,7 +114,7 @@ module Rookout
|
|
112
114
|
quota = configuration["RUBY_GLOBAL_RATE_LIMIT_QUOTA_MS"]
|
113
115
|
window_size = configuration["RUBY_GLOBAL_RATE_LIMIT_WINDOW_SIZE_MS"]
|
114
116
|
|
115
|
-
if quota != "" && window_size != ""
|
117
|
+
if quota != "" && !quota.nil? && window_size != "" && !window_size.nil?
|
116
118
|
global_rate_limit = "#{quota}/#{window_size}"
|
117
119
|
end
|
118
120
|
end
|
data/lib/rookout/exceptions.rb
CHANGED
data/lib/rookout/interface.rb
CHANGED
@@ -91,23 +91,23 @@ module Rookout
|
|
91
91
|
def dump log_object_errors
|
92
92
|
dump_raw_object @obj, 0, @dump_config, log_object_errors
|
93
93
|
end
|
94
|
-
end
|
95
94
|
|
96
|
-
|
95
|
+
private
|
97
96
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
97
|
+
def read_key_as_int key
|
98
|
+
key_int = key.to_i
|
99
|
+
return RubyObjectNamespace.new @obj[key_int] if key_int >= 0 && key_int < @obj.length
|
100
|
+
raise Exceptions::RookKeyNotFound, key
|
101
|
+
end
|
103
102
|
|
104
|
-
|
105
|
-
|
106
|
-
|
103
|
+
def read_key_from_hash key
|
104
|
+
return RubyObjectNamespace.new @obj[key] if @obj.key? key
|
105
|
+
return RubyObjectNamespace.new @obj[key.to_sym] if @obj.key? key.to_s.to_sym
|
107
106
|
|
108
|
-
|
107
|
+
@obj.each { |it, value| return RubyObjectNamespace.new value if it.to_s == key }
|
109
108
|
|
110
|
-
|
109
|
+
raise Exceptions::RookKeyNotFound, key
|
110
|
+
end
|
111
111
|
end
|
112
112
|
end
|
113
113
|
end
|
data/lib/rookout/utils.rb
CHANGED
@@ -1,26 +1,34 @@
|
|
1
|
-
module
|
2
|
-
|
1
|
+
module Rookout
|
2
|
+
module Utils
|
3
|
+
require "securerandom"
|
4
|
+
require_relative "config"
|
3
5
|
|
4
|
-
|
6
|
+
module_function
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
8
|
+
def uuid
|
9
|
+
SecureRandom.uuid.gsub(/-/, "")
|
10
|
+
end
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
def milliseconds_to_nanoseconds milliseconds
|
13
|
+
nano = milliseconds * (10**6)
|
14
|
+
nano.to_i
|
15
|
+
end
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
def time_to_nanoseconds time_obj
|
18
|
+
secs = time_obj.to_i
|
19
|
+
nsecs = time_obj.nsec
|
20
|
+
((10**9) * secs) + nsecs
|
21
|
+
end
|
22
|
+
|
23
|
+
def quiet_puts msg
|
24
|
+
# rubocop:disable Style/StderrPuts
|
25
|
+
return if Config.quiet
|
26
|
+
$stderr.puts msg
|
27
|
+
# rubocop:enable Style/StderrPuts
|
28
|
+
end
|
21
29
|
|
22
|
-
|
23
|
-
|
24
|
-
|
30
|
+
def is_number? string
|
31
|
+
true if Float(string) rescue false
|
32
|
+
end
|
25
33
|
end
|
26
34
|
end
|
data/lib/rookout/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rookout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.44
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liran Haimovitch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: binding_of_caller
|