fozzie 0.0.25 → 0.0.26
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fozzie/configuration.rb +11 -4
- data/lib/fozzie/socket.rb +1 -1
- data/lib/fozzie/version.rb +1 -1
- data/spec/lib/fozzie/configuration_spec.rb +9 -0
- data/spec/lib/fozzie/interface_spec.rb +11 -0
- metadata +4 -4
data/lib/fozzie/configuration.rb
CHANGED
@@ -10,19 +10,25 @@ module Fozzie
|
|
10
10
|
class Configuration
|
11
11
|
include Sys
|
12
12
|
|
13
|
-
attr_accessor :env, :config_path, :host, :port, :appname, :namespaces, :timeout, :monitor_classes, :sniff_envs
|
13
|
+
attr_accessor :env, :config_path, :host, :port, :appname, :namespaces, :timeout, :monitor_classes, :sniff_envs, :ignore_prefix
|
14
14
|
|
15
15
|
def initialize(args = {})
|
16
16
|
merge_and_assign_config(args)
|
17
17
|
self.origin_name
|
18
18
|
end
|
19
19
|
|
20
|
+
def disable_prefix
|
21
|
+
@ignore_prefix = true
|
22
|
+
end
|
23
|
+
|
20
24
|
# Returns the prefix for any stat requested to be registered
|
21
25
|
def data_prefix
|
22
|
-
|
26
|
+
return nil if @ignore_prefix
|
27
|
+
|
28
|
+
@data_prefix ||= [appname, origin_name, env].collect do |s|
|
23
29
|
s.empty? ? nil : s.gsub('.', '-')
|
24
30
|
end.compact.join('.').strip
|
25
|
-
(
|
31
|
+
(@data_prefix.empty? ? nil : @data_prefix)
|
26
32
|
end
|
27
33
|
|
28
34
|
# Returns the origin name of the current machine to register the stat against
|
@@ -56,7 +62,8 @@ module Fozzie
|
|
56
62
|
:namespaces => %w{Stats S Statistics Warehouse},
|
57
63
|
:timeout => 0.5,
|
58
64
|
:monitor_classes => [],
|
59
|
-
:sniff_envs => [:development, :staging, :production]
|
65
|
+
:sniff_envs => [:development, :staging, :production],
|
66
|
+
:ignore_prefix => false
|
60
67
|
}.dup
|
61
68
|
end
|
62
69
|
|
data/lib/fozzie/socket.rb
CHANGED
data/lib/fozzie/version.rb
CHANGED
@@ -166,4 +166,15 @@ describe Fozzie::Interface do
|
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
169
|
+
describe "without prefix" do
|
170
|
+
|
171
|
+
it "registers stats without app, etc" do
|
172
|
+
Fozzie.c.disable_prefix
|
173
|
+
subject.expects(:send_to_socket).with {|bin| bin.match(/^mystat/) }
|
174
|
+
|
175
|
+
subject.gauge("mystat", 99)
|
176
|
+
end
|
177
|
+
|
178
|
+
end
|
179
|
+
|
169
180
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fozzie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.26
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-07-
|
13
|
+
date: 2012-07-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: sys-uname
|
@@ -262,7 +262,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
262
262
|
version: '0'
|
263
263
|
segments:
|
264
264
|
- 0
|
265
|
-
hash: -
|
265
|
+
hash: -2413055484564325442
|
266
266
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
267
|
none: false
|
268
268
|
requirements:
|
@@ -271,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
271
|
version: '0'
|
272
272
|
segments:
|
273
273
|
- 0
|
274
|
-
hash: -
|
274
|
+
hash: -2413055484564325442
|
275
275
|
requirements: []
|
276
276
|
rubyforge_project: fozzie
|
277
277
|
rubygems_version: 1.8.24
|