fluent-plugin-buffered-metrics 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -57,7 +57,7 @@ Note that the following is at test configuration, appending to a file on the loc
57
57
  prefix fluentd.<hostname>.5m
58
58
  #url tcp://localhost:2003
59
59
  url file:///var/tmp/graphite_test.out
60
- sum_defaults [{"-.-.-.count":0},{"-.-.-.bytes":0}]
60
+ sum_defaults [{"name":"-.-.-.count","value":0},{"name":"-.-.-.bytes","value":0}]
61
61
  sum_maps {"event['record'].empty? ? false : 1":["-.-.-.count","(['tag','facility','level'].map {|t| event['record'][t] || '-'}+['count']).join('.')"],"event['record'].empty? ? false : event.to_s.length":["-.-.-.bytes","(['tag','facility','level'].map {|t| event['record'][t] || '-'}+['bytes']).join('.')"]}
62
62
  metric_maps {}
63
63
  metric_defaults []
@@ -106,12 +106,14 @@ So, even though there is only one event matching condition, two distinct metrics
106
106
  ```JSON
107
107
  [
108
108
  {
109
- "-.-.-.count" : 0
109
+ "name": "-.-.-.count",
110
+ "value": 0
110
111
  },
111
112
  {
112
- "-.-.-.bytes" : 0
113
+ "name": "-.-.-.bytes",
114
+ "value": 0
113
115
  }
114
116
  ]
115
117
  ```
116
118
 
117
- The "defaults" specifications are needed if there are metrics which need to be sent with every metrics publication, even it none of the matches are met and the metric is never created during the run. This may be more of an artifact, as this was initially done for Stackdriver, which had real issues with gaps in metrics series.
119
+ The "defaults" specifications are needed if there are metrics which need to be sent with every metrics publication, even it none of the matches are met and the metric is never created during the run. This may be more of an artifact, as this was initially done for Stackdriver, which had real issues with gaps in metrics series.
@@ -46,9 +46,9 @@ module Fluent
46
46
  unless @prefix.nil?
47
47
 
48
48
  begin
49
- @prefix = eval(@prefix) || eval('"'+@prefix+'"')
50
- rescue
51
- raise ArgumentError, "Error setting prefix from '#{@prefix}'"
49
+ @prefix = eval(@prefix)
50
+ rescue Exception
51
+ @prefix = eval('"'+@prefix+'"')
52
52
  end
53
53
 
54
54
  @base_entry['prefix'] = @prefix unless @prefix.empty?
@@ -141,9 +141,7 @@ module Fluent
141
141
  end
142
142
 
143
143
  @sum_defaults.each do |e|
144
- if e.key?('name') and not e['name'].nil? and not e['name'].empty?
145
- sum_data[e['name']] = e['value'] unless sum_data.key?(e['name'])
146
- end
144
+ sum_data[e['name']] = e['value'] unless sum_data.key?(e['name'])
147
145
  end
148
146
 
149
147
  @metrics_backend.buffer_append_array_of_hashes(
@@ -154,9 +152,7 @@ module Fluent
154
152
 
155
153
  @metrics_backend.buffer_append_array_of_hashes(
156
154
  @metric_defaults.map {|e|
157
- if e.key?('name') and not e['name'].nil? and not e['name'].empty?
158
- @base_entry.merge(e).merge({'time' => timestamp}) unless metric_data.key?(e['name'])
159
- end
155
+ @base_entry.merge(e).merge({'time' => timestamp}) unless metric_data.key?(e['name'])
160
156
  }
161
157
  )
162
158
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-buffered-metrics
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Yamauchi
@@ -41,7 +41,7 @@ cert_chain:
41
41
  2Zk648Ep9HVPKmwoVuB75+xEQw==
42
42
  -----END CERTIFICATE-----
43
43
 
44
- date: 2018-04-05 00:00:00 Z
44
+ date: 2018-04-06 00:00:00 Z
45
45
  dependencies:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: fluentd
metadata.gz.sig CHANGED
Binary file