recognizer 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.org +4 -4
- data/lib/recognizer/librato.rb +5 -5
- data/lib/recognizer/version.rb +1 -1
- metadata +3 -3
data/README.org
CHANGED
@@ -25,18 +25,18 @@
|
|
25
25
|
* More
|
26
26
|
Example metric path: =production.i-424242.cpu.user=
|
27
27
|
|
28
|
-
|
28
|
+
Extract the metric source from the metric path using a regular expression
|
29
29
|
: {
|
30
30
|
: "librato": {
|
31
|
-
: "
|
31
|
+
: "metric_source": "/i-.*/"
|
32
32
|
Or using an index
|
33
33
|
: {
|
34
34
|
: "librato": {
|
35
|
-
: "
|
35
|
+
: "metric_source": 1
|
36
36
|
Or define a static source
|
37
37
|
: {
|
38
38
|
: "librato": {
|
39
|
-
: "
|
39
|
+
: "metric_source": "example"
|
40
40
|
By default, Recognizer uses the source: =recognizer=
|
41
41
|
* License
|
42
42
|
Recognizer is released under the [[https://github.com/portertech/recognizer/raw/master/MIT-LICENSE.txt][MIT license]].
|
data/lib/recognizer/librato.rb
CHANGED
@@ -33,16 +33,16 @@ module Recognizer
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
get_source = case options[:librato][:
|
36
|
+
get_source = case options[:librato][:metric_source]
|
37
37
|
when String
|
38
|
-
if options[:librato][:
|
39
|
-
@source_pattern = Regexp.new(options[:librato][:
|
38
|
+
if options[:librato][:metric_source].match("^/.*/$")
|
39
|
+
@source_pattern = Regexp.new(options[:librato][:metric_source].delete("/"))
|
40
40
|
Proc.new { |path| (matched = path.grep(@source_pattern).first) ? matched : "recognizer" }
|
41
41
|
else
|
42
|
-
Proc.new { options[:librato][:
|
42
|
+
Proc.new { options[:librato][:metric_source] }
|
43
43
|
end
|
44
44
|
when Integer
|
45
|
-
Proc.new { |path| path.slice(options[:librato][:
|
45
|
+
Proc.new { |path| path.slice(options[:librato][:metric_source]) }
|
46
46
|
else
|
47
47
|
Proc.new { "recognizer" }
|
48
48
|
end
|
data/lib/recognizer/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recognizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sean Porter
|