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 CHANGED
@@ -25,18 +25,18 @@
25
25
  * More
26
26
  Example metric path: =production.i-424242.cpu.user=
27
27
 
28
- Get the source from the metric path using a regular expression
28
+ Extract the metric source from the metric path using a regular expression
29
29
  : {
30
30
  : "librato": {
31
- : "source": "/i-.*/"
31
+ : "metric_source": "/i-.*/"
32
32
  Or using an index
33
33
  : {
34
34
  : "librato": {
35
- : "source": 1
35
+ : "metric_source": 1
36
36
  Or define a static source
37
37
  : {
38
38
  : "librato": {
39
- : "source": "custom"
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]].
@@ -33,16 +33,16 @@ module Recognizer
33
33
  end
34
34
  end
35
35
 
36
- get_source = case options[:librato][:source]
36
+ get_source = case options[:librato][:metric_source]
37
37
  when String
38
- if options[:librato][:source].match("^/.*/$")
39
- @source_pattern = Regexp.new(options[:librato][:source].delete("/"))
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][:source] }
42
+ Proc.new { options[:librato][:metric_source] }
43
43
  end
44
44
  when Integer
45
- Proc.new { |path| path.slice(options[:librato][:source]) }
45
+ Proc.new { |path| path.slice(options[:librato][:metric_source]) }
46
46
  else
47
47
  Proc.new { "recognizer" }
48
48
  end
@@ -1,3 +1,3 @@
1
1
  module Recognizer
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
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: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sean Porter