skylight 0.0.7 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/skylight +5 -0
- data/lib/skylight.rb +2 -0
- data/lib/skylight/cli.rb +84 -0
- data/lib/skylight/config.rb +53 -6
- data/lib/skylight/instrumenter.rb +4 -1
- data/lib/skylight/json_proto.rb +0 -3
- data/lib/skylight/middleware.rb +1 -0
- data/lib/skylight/normalize.rb +30 -5
- data/lib/skylight/normalize/process_action.rb +1 -1
- data/lib/skylight/normalize/render_collection.rb +2 -6
- data/lib/skylight/normalize/render_partial.rb +2 -5
- data/lib/skylight/normalize/render_template.rb +2 -5
- data/lib/skylight/normalize/sql.rb +2 -4
- data/lib/skylight/railtie.rb +30 -33
- data/lib/skylight/sanity_checker.rb +73 -0
- data/lib/skylight/subscriber.rb +1 -15
- data/lib/skylight/trace.rb +30 -5
- data/lib/skylight/util/http.rb +97 -0
- data/lib/skylight/vendor/highline.rb +1012 -0
- data/lib/skylight/vendor/highline/color_scheme.rb +134 -0
- data/lib/skylight/vendor/highline/compatibility.rb +16 -0
- data/lib/skylight/vendor/highline/import.rb +41 -0
- data/lib/skylight/vendor/highline/menu.rb +398 -0
- data/lib/skylight/vendor/highline/question.rb +475 -0
- data/lib/skylight/vendor/highline/simulate.rb +48 -0
- data/lib/skylight/vendor/highline/string_extensions.rb +131 -0
- data/lib/skylight/vendor/highline/style.rb +181 -0
- data/lib/skylight/vendor/highline/system_extensions.rb +218 -0
- data/lib/skylight/vendor/thor.rb +473 -0
- data/lib/skylight/vendor/thor/actions.rb +318 -0
- data/lib/skylight/vendor/thor/actions/create_file.rb +105 -0
- data/lib/skylight/vendor/thor/actions/create_link.rb +60 -0
- data/lib/skylight/vendor/thor/actions/directory.rb +119 -0
- data/lib/skylight/vendor/thor/actions/empty_directory.rb +137 -0
- data/lib/skylight/vendor/thor/actions/file_manipulation.rb +314 -0
- data/lib/skylight/vendor/thor/actions/inject_into_file.rb +109 -0
- data/lib/skylight/vendor/thor/base.rb +652 -0
- data/lib/skylight/vendor/thor/command.rb +136 -0
- data/lib/skylight/vendor/thor/core_ext/hash_with_indifferent_access.rb +80 -0
- data/lib/skylight/vendor/thor/core_ext/io_binary_read.rb +12 -0
- data/lib/skylight/vendor/thor/core_ext/ordered_hash.rb +100 -0
- data/lib/skylight/vendor/thor/error.rb +28 -0
- data/lib/skylight/vendor/thor/group.rb +282 -0
- data/lib/skylight/vendor/thor/invocation.rb +172 -0
- data/lib/skylight/vendor/thor/parser.rb +4 -0
- data/lib/skylight/vendor/thor/parser/argument.rb +74 -0
- data/lib/skylight/vendor/thor/parser/arguments.rb +171 -0
- data/lib/skylight/vendor/thor/parser/option.rb +121 -0
- data/lib/skylight/vendor/thor/parser/options.rb +218 -0
- data/lib/skylight/vendor/thor/rake_compat.rb +72 -0
- data/lib/skylight/vendor/thor/runner.rb +322 -0
- data/lib/skylight/vendor/thor/shell.rb +88 -0
- data/lib/skylight/vendor/thor/shell/basic.rb +393 -0
- data/lib/skylight/vendor/thor/shell/color.rb +148 -0
- data/lib/skylight/vendor/thor/shell/html.rb +127 -0
- data/lib/skylight/vendor/thor/util.rb +270 -0
- data/lib/skylight/vendor/thor/version.rb +3 -0
- data/lib/skylight/version.rb +1 -1
- data/lib/skylight/worker.rb +3 -58
- metadata +56 -18
data/lib/skylight/version.rb
CHANGED
data/lib/skylight/worker.rb
CHANGED
@@ -37,10 +37,11 @@ module Skylight
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
attr_reader :instrumenter, :connection
|
40
|
+
attr_reader :instrumenter, :connection, :config
|
41
41
|
|
42
42
|
def initialize(instrumenter)
|
43
43
|
@instrumenter = instrumenter
|
44
|
+
@config = instrumenter.config
|
44
45
|
@interval = config.interval
|
45
46
|
@protocol = config.protocol
|
46
47
|
|
@@ -110,10 +111,6 @@ module Skylight
|
|
110
111
|
|
111
112
|
private
|
112
113
|
|
113
|
-
def config
|
114
|
-
@instrumenter.config
|
115
|
-
end
|
116
|
-
|
117
114
|
def start(now, interval)
|
118
115
|
(now / interval) * interval
|
119
116
|
end
|
@@ -152,59 +149,7 @@ module Skylight
|
|
152
149
|
# write the body
|
153
150
|
@protocol.write(body, batch.from, batch.counts, batch.sample)
|
154
151
|
|
155
|
-
|
156
|
-
body = Util::Gzip.compress(body)
|
157
|
-
end
|
158
|
-
|
159
|
-
# send
|
160
|
-
http_post(body)
|
161
|
-
end
|
162
|
-
|
163
|
-
def http_post(body)
|
164
|
-
req = http_request(body.bytesize)
|
165
|
-
req.body = body
|
166
|
-
|
167
|
-
debug "Posting report to server"
|
168
|
-
http = Net::HTTP.new config.host, config.port
|
169
|
-
|
170
|
-
if config.ssl?
|
171
|
-
http.use_ssl = true
|
172
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
173
|
-
end
|
174
|
-
|
175
|
-
http.start do |client|
|
176
|
-
resp = client.request req
|
177
|
-
|
178
|
-
unless resp.code == '200'
|
179
|
-
debug "Server responded with #{resp.code}"
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
true
|
184
|
-
rescue => e
|
185
|
-
logger.error "[SKYLIGHT] POST #{config.host}:#{config.port}(ssl=#{config.ssl?}) - #{e.message} - #{e.class} - #{e.backtrace.first}"
|
186
|
-
if logger.debug?
|
187
|
-
logger.debug(e.backtrace.join("\n"))
|
188
|
-
end
|
189
|
-
end
|
190
|
-
|
191
|
-
def http_request(length)
|
192
|
-
hdrs = {}
|
193
|
-
|
194
|
-
hdrs[CONTENT_LENGTH] = length.to_s
|
195
|
-
hdrs[AUTHORIZATION] = config.authentication_token
|
196
|
-
hdrs[CONTENT_TYPE] = APPLICATION_JSON
|
197
|
-
|
198
|
-
if config.deflate?
|
199
|
-
hdrs[CONTENT_ENCODING] = GZIP
|
200
|
-
end
|
201
|
-
|
202
|
-
Net::HTTPGenericRequest.new \
|
203
|
-
'POST', # Request method
|
204
|
-
true, # There is a request body
|
205
|
-
true, # There is a response body
|
206
|
-
ENDPOINT, # Endpoint
|
207
|
-
hdrs
|
152
|
+
@config.http.post(ENDPOINT, body)
|
208
153
|
end
|
209
154
|
|
210
155
|
def debug(msg)
|
metadata
CHANGED
@@ -1,56 +1,53 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skylight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.10
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Tilde, Inc.
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-22 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: activesupport
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 3.0.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 3.0.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: actionpack
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: 3.0.0
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: 3.0.0
|
46
41
|
description: Currently in pre-alpha.
|
47
42
|
email:
|
48
43
|
- engineering@tilde.io
|
49
|
-
executables:
|
44
|
+
executables:
|
45
|
+
- skylight
|
50
46
|
extensions: []
|
51
47
|
extra_rdoc_files: []
|
52
48
|
files:
|
53
49
|
- lib/skylight.rb
|
50
|
+
- lib/skylight/cli.rb
|
54
51
|
- lib/skylight/compat.rb
|
55
52
|
- lib/skylight/compat/notifications.rb
|
56
53
|
- lib/skylight/compat/notifications/fanout.rb
|
@@ -70,6 +67,7 @@ files:
|
|
70
67
|
- lib/skylight/normalize/sql.rb
|
71
68
|
- lib/skylight/normalize/start_processing.rb
|
72
69
|
- lib/skylight/railtie.rb
|
70
|
+
- lib/skylight/sanity_checker.rb
|
73
71
|
- lib/skylight/subscriber.rb
|
74
72
|
- lib/skylight/trace.rb
|
75
73
|
- lib/skylight/util/atomic.rb
|
@@ -77,34 +75,74 @@ files:
|
|
77
75
|
- lib/skylight/util/clock.rb
|
78
76
|
- lib/skylight/util/ewma.rb
|
79
77
|
- lib/skylight/util/gzip.rb
|
78
|
+
- lib/skylight/util/http.rb
|
80
79
|
- lib/skylight/util/queue.rb
|
81
80
|
- lib/skylight/util/uniform_sample.rb
|
82
81
|
- lib/skylight/util/uuid.rb
|
82
|
+
- lib/skylight/vendor/highline.rb
|
83
|
+
- lib/skylight/vendor/highline/color_scheme.rb
|
84
|
+
- lib/skylight/vendor/highline/compatibility.rb
|
85
|
+
- lib/skylight/vendor/highline/import.rb
|
86
|
+
- lib/skylight/vendor/highline/menu.rb
|
87
|
+
- lib/skylight/vendor/highline/question.rb
|
88
|
+
- lib/skylight/vendor/highline/simulate.rb
|
89
|
+
- lib/skylight/vendor/highline/string_extensions.rb
|
90
|
+
- lib/skylight/vendor/highline/style.rb
|
91
|
+
- lib/skylight/vendor/highline/system_extensions.rb
|
92
|
+
- lib/skylight/vendor/thor.rb
|
93
|
+
- lib/skylight/vendor/thor/actions.rb
|
94
|
+
- lib/skylight/vendor/thor/actions/create_file.rb
|
95
|
+
- lib/skylight/vendor/thor/actions/create_link.rb
|
96
|
+
- lib/skylight/vendor/thor/actions/directory.rb
|
97
|
+
- lib/skylight/vendor/thor/actions/empty_directory.rb
|
98
|
+
- lib/skylight/vendor/thor/actions/file_manipulation.rb
|
99
|
+
- lib/skylight/vendor/thor/actions/inject_into_file.rb
|
100
|
+
- lib/skylight/vendor/thor/base.rb
|
101
|
+
- lib/skylight/vendor/thor/command.rb
|
102
|
+
- lib/skylight/vendor/thor/core_ext/hash_with_indifferent_access.rb
|
103
|
+
- lib/skylight/vendor/thor/core_ext/io_binary_read.rb
|
104
|
+
- lib/skylight/vendor/thor/core_ext/ordered_hash.rb
|
105
|
+
- lib/skylight/vendor/thor/error.rb
|
106
|
+
- lib/skylight/vendor/thor/group.rb
|
107
|
+
- lib/skylight/vendor/thor/invocation.rb
|
108
|
+
- lib/skylight/vendor/thor/parser.rb
|
109
|
+
- lib/skylight/vendor/thor/parser/argument.rb
|
110
|
+
- lib/skylight/vendor/thor/parser/arguments.rb
|
111
|
+
- lib/skylight/vendor/thor/parser/option.rb
|
112
|
+
- lib/skylight/vendor/thor/parser/options.rb
|
113
|
+
- lib/skylight/vendor/thor/rake_compat.rb
|
114
|
+
- lib/skylight/vendor/thor/runner.rb
|
115
|
+
- lib/skylight/vendor/thor/shell.rb
|
116
|
+
- lib/skylight/vendor/thor/shell/basic.rb
|
117
|
+
- lib/skylight/vendor/thor/shell/color.rb
|
118
|
+
- lib/skylight/vendor/thor/shell/html.rb
|
119
|
+
- lib/skylight/vendor/thor/util.rb
|
120
|
+
- lib/skylight/vendor/thor/version.rb
|
83
121
|
- lib/skylight/version.rb
|
84
122
|
- lib/skylight/worker.rb
|
85
123
|
- README.md
|
124
|
+
- bin/skylight
|
86
125
|
homepage: http://www.skylight.io
|
87
126
|
licenses: []
|
127
|
+
metadata: {}
|
88
128
|
post_install_message:
|
89
129
|
rdoc_options: []
|
90
130
|
require_paths:
|
91
131
|
- lib
|
92
132
|
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
-
none: false
|
94
133
|
requirements:
|
95
|
-
- -
|
134
|
+
- - '>='
|
96
135
|
- !ruby/object:Gem::Version
|
97
136
|
version: 1.9.2
|
98
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
-
none: false
|
100
138
|
requirements:
|
101
|
-
- -
|
139
|
+
- - '>='
|
102
140
|
- !ruby/object:Gem::Version
|
103
141
|
version: '0'
|
104
142
|
requirements: []
|
105
143
|
rubyforge_project:
|
106
|
-
rubygems_version:
|
144
|
+
rubygems_version: 2.0.3
|
107
145
|
signing_key:
|
108
|
-
specification_version:
|
146
|
+
specification_version: 4
|
109
147
|
summary: Skylight is a ruby application monitoring tool.
|
110
148
|
test_files: []
|