skylight 0.5.0.beta1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -1
- data/lib/skylight/config.rb +10 -5
- data/lib/skylight/instrumenter.rb +3 -11
- data/lib/skylight/normalizers/moped/query.rb +4 -4
- data/lib/skylight/railtie.rb +1 -1
- data/lib/skylight/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e78118dc565426a957d8f55afe082e19b6b342c6
|
4
|
+
data.tar.gz: 6486c1af0cc556a30bcc9763df080dcdcc465f94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70fd431199b0b0b55afa2fad0d0009ac94b0b77458022ac4fd8904b0281ece7353f87c4f2bbbb315a5c7c5330cf240950c6f20491953419b78cfccc3307c9a9c
|
7
|
+
data.tar.gz: b518630c1a7adc80873a0b4d415a4312006a51f947ee767e5bd81d1e9232a2cda4e3b7081e0133e830ffd9bbda3ac33cda83515850f4a3250518d8e3b3501832
|
data/CHANGELOG.md
CHANGED
data/lib/skylight/config.rb
CHANGED
@@ -171,10 +171,13 @@ module Skylight
|
|
171
171
|
end
|
172
172
|
end
|
173
173
|
|
174
|
-
def self.load(
|
174
|
+
def self.load(opts = {}, env = ENV)
|
175
175
|
attrs = {}
|
176
176
|
version = nil
|
177
177
|
|
178
|
+
path = opts.delete(:file)
|
179
|
+
environment = opts.delete(:environment)
|
180
|
+
|
178
181
|
if path
|
179
182
|
error = nil
|
180
183
|
begin
|
@@ -194,11 +197,13 @@ module Skylight
|
|
194
197
|
attrs[:priority] = remap_env(env)
|
195
198
|
end
|
196
199
|
|
197
|
-
new(environment, attrs)
|
198
|
-
|
200
|
+
config = new(environment, attrs)
|
201
|
+
|
202
|
+
opts.each do |k, v|
|
203
|
+
config[k] = v
|
204
|
+
end
|
199
205
|
|
200
|
-
|
201
|
-
self.load(nil, nil, env)
|
206
|
+
config
|
202
207
|
end
|
203
208
|
|
204
209
|
def self.remap_key(key)
|
@@ -32,16 +32,13 @@ module Skylight
|
|
32
32
|
def self.start!(config = nil)
|
33
33
|
return @instance if @instance
|
34
34
|
|
35
|
-
# Initialize here so we can catch errors
|
36
|
-
config ||= Config.new
|
37
|
-
|
38
35
|
LOCK.synchronize do
|
39
36
|
return @instance if @instance
|
40
37
|
@instance = new(config).start!
|
41
38
|
end
|
42
39
|
rescue => e
|
43
40
|
message = sprintf("[SKYLIGHT] [#{Skylight::VERSION}] Unable to start Instrumenter; msg=%s; class=%s", e.message, e.class)
|
44
|
-
if config
|
41
|
+
if config && config.respond_to?(:logger)
|
45
42
|
config.logger.warn message
|
46
43
|
else
|
47
44
|
warn message
|
@@ -72,16 +69,11 @@ module Skylight
|
|
72
69
|
end
|
73
70
|
end
|
74
71
|
|
75
|
-
|
76
72
|
attr_reader :config, :gc, :trace_info
|
77
73
|
|
78
74
|
def self.new(config)
|
79
|
-
|
80
|
-
|
81
|
-
elsif Hash === config
|
82
|
-
config = Config.new(config)
|
83
|
-
end
|
84
|
-
|
75
|
+
config ||= {}
|
76
|
+
config = Config.load(config) unless config.is_a?(Config)
|
85
77
|
config.validate!
|
86
78
|
|
87
79
|
inst = native_new(config.to_env)
|
@@ -117,18 +117,18 @@ module Skylight
|
|
117
117
|
end
|
118
118
|
|
119
119
|
def extract_binds(hash, binds=[])
|
120
|
-
|
120
|
+
ret = {}
|
121
121
|
|
122
122
|
hash.each do |k,v|
|
123
123
|
if v.is_a?(Hash)
|
124
|
-
|
124
|
+
ret[k] = extract_binds(v, binds)[0]
|
125
125
|
else
|
126
126
|
binds << stringify(hash[k])
|
127
|
-
|
127
|
+
ret[k] = '?'
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
131
|
-
[
|
131
|
+
[ret, binds]
|
132
132
|
end
|
133
133
|
|
134
134
|
def stringify(value)
|
data/lib/skylight/railtie.rb
CHANGED
data/lib/skylight/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skylight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.0
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tilde, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -162,9 +162,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
162
162
|
version: 1.9.2
|
163
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
|
-
- - "
|
165
|
+
- - ">="
|
166
166
|
- !ruby/object:Gem::Version
|
167
|
-
version:
|
167
|
+
version: '0'
|
168
168
|
requirements: []
|
169
169
|
rubyforge_project:
|
170
170
|
rubygems_version: 2.2.2
|