instrumental_agent 0.12.2 → 0.12.3
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.
- data/CHANGELOG.md +3 -0
- data/Gemfile +2 -2
- data/lib/instrumental/agent.rb +5 -3
- data/lib/instrumental/version.rb +1 -1
- data/spec/agent_spec.rb +6 -0
- metadata +5 -5
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/lib/instrumental/agent.rb
CHANGED
|
@@ -40,13 +40,13 @@ module Instrumental
|
|
|
40
40
|
)
|
|
41
41
|
|
|
42
42
|
# defaults
|
|
43
|
-
# host: instrumentalapp.com
|
|
43
|
+
# host: collector.instrumentalapp.com
|
|
44
44
|
# port: 8000
|
|
45
45
|
# enabled: true
|
|
46
46
|
# synchronous: false
|
|
47
47
|
@api_key = api_key
|
|
48
48
|
@host, @port = options[:collector].to_s.split(':')
|
|
49
|
-
@host ||= 'instrumentalapp.com'
|
|
49
|
+
@host ||= 'collector.instrumentalapp.com'
|
|
50
50
|
@port = (@port || 8000).to_i
|
|
51
51
|
@enabled = options.has_key?(:enabled) ? !!options[:enabled] : true
|
|
52
52
|
@synchronous = !!options[:synchronous]
|
|
@@ -239,10 +239,10 @@ module Instrumental
|
|
|
239
239
|
end
|
|
240
240
|
|
|
241
241
|
def send_command(cmd, *args)
|
|
242
|
+
cmd = "%s %s\n" % [cmd, args.collect { |a| a.to_s }.join(" ")]
|
|
242
243
|
if enabled?
|
|
243
244
|
start_connection_worker if !running?
|
|
244
245
|
|
|
245
|
-
cmd = "%s %s\n" % [cmd, args.collect { |a| a.to_s }.join(" ")]
|
|
246
246
|
if @queue.size < MAX_BUFFER
|
|
247
247
|
@queue_full_warning = false
|
|
248
248
|
logger.debug "Queueing: #{cmd.chomp}"
|
|
@@ -255,6 +255,8 @@ module Instrumental
|
|
|
255
255
|
logger.debug "Dropping command, queue full(#{@queue.size}): #{cmd.chomp}"
|
|
256
256
|
nil
|
|
257
257
|
end
|
|
258
|
+
else
|
|
259
|
+
logger.debug cmd.strip
|
|
258
260
|
end
|
|
259
261
|
end
|
|
260
262
|
|
data/lib/instrumental/version.rb
CHANGED
data/spec/agent_spec.rb
CHANGED
|
@@ -48,6 +48,12 @@ describe Instrumental::Agent, "disabled" do
|
|
|
48
48
|
wait
|
|
49
49
|
@server.commands.should be_empty
|
|
50
50
|
end
|
|
51
|
+
|
|
52
|
+
it "should send metrics to logger" do
|
|
53
|
+
now = Time.now
|
|
54
|
+
@agent.logger.should_receive(:debug).with("gauge metric 1 #{now.to_i} 1")
|
|
55
|
+
@agent.gauge("metric", 1)
|
|
56
|
+
end
|
|
51
57
|
end
|
|
52
58
|
|
|
53
59
|
describe Instrumental::Agent, "enabled" do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: instrumental_agent
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.12.
|
|
4
|
+
version: 0.12.3
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -12,7 +12,7 @@ authors:
|
|
|
12
12
|
autorequire:
|
|
13
13
|
bindir: bin
|
|
14
14
|
cert_chain: []
|
|
15
|
-
date: 2013-
|
|
15
|
+
date: 2013-04-26 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: rake
|
|
@@ -165,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
165
165
|
version: '0'
|
|
166
166
|
segments:
|
|
167
167
|
- 0
|
|
168
|
-
hash: -
|
|
168
|
+
hash: -1789921750295419555
|
|
169
169
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
none: false
|
|
171
171
|
requirements:
|
|
@@ -174,10 +174,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
174
174
|
version: '0'
|
|
175
175
|
segments:
|
|
176
176
|
- 0
|
|
177
|
-
hash: -
|
|
177
|
+
hash: -1789921750295419555
|
|
178
178
|
requirements: []
|
|
179
179
|
rubyforge_project:
|
|
180
|
-
rubygems_version: 1.8.
|
|
180
|
+
rubygems_version: 1.8.24
|
|
181
181
|
signing_key:
|
|
182
182
|
specification_version: 3
|
|
183
183
|
summary: Agent for reporting data to instrumentalapp.com
|