logstash-filter-metrics 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ae073bd8a88f8fdc36369ac0fbc804e2da56f23e
4
- data.tar.gz: 8f9f726f6edb421cb0e52eb891cf123bf12dd720
3
+ metadata.gz: d4fc93f8263cbaaf90ed6ab1ab2551a6c52c5a2e
4
+ data.tar.gz: f036d56d5e2cdcda610b22a391064f02672d2317
5
5
  SHA512:
6
- metadata.gz: 10c21adaf28dc15b484a915c29217a8a5e1861a8bbbd77a020857fc587927197fc0e4dc6040513a77ff4fd634878d69159ccb6c44efb659d1322b38d90d6cb98
7
- data.tar.gz: 2b8823c3a5ed75523097408c792193f4b5d08ab84aa9726f2cf65b6b67a93275537cd1ebaac8ed71f9ecbee8218959f738c9161f3aad1e8f617b4a23294ac047
6
+ metadata.gz: 82a72cdb24ab5d9ce5fa02e00012069c60f83aa0c67a6d3e8e1d96495c34a2af170eb2329741d7485d8171492b587f68779a9768fc9907acf1a6fa75ccf396f4
7
+ data.tar.gz: 441b646d361ae985950cc51d566b49b7b78cf9f836206d6bf099c559c839c2e3979393a676f59a6be15b7482ab8aa25edb8f752c5037f7ed6bf6914a57eedbee
@@ -1,3 +1,6 @@
1
+ ## 4.0.4
2
+ - Fix some documentation issues
3
+
1
4
  ## 4.0.2
2
5
  - Relax constraint on logstash-core-plugin-api to >= 1.60 <= 2.99
3
6
 
@@ -12,7 +12,7 @@ START - GENERATED VARIABLES, DO NOT EDIT!
12
12
  END - GENERATED VARIABLES, DO NOT EDIT!
13
13
  ///////////////////////////////////////////
14
14
 
15
- [id="plugins-{type}-{plugin}"]
15
+ [id="plugins-{type}s-{plugin}"]
16
16
 
17
17
  === Metrics filter plugin
18
18
 
@@ -60,12 +60,12 @@ For a `meter => "something"` you will receive the following fields:
60
60
 
61
61
  ==== `timer` values
62
62
 
63
- For a `timer => [ "thing", "%{duration}" ]` you will receive the following fields:
63
+ For a `timer => { "thing" => "%{duration}" }` you will receive the following fields:
64
64
 
65
65
  * "[thing][count]" - the total count of events
66
- * "[thing][rate_1m]" - the per-second event rate in a 1-minute sliding window
67
- * "[thing][rate_5m]" - the per-second event rate in a 5-minute sliding window
68
- * "[thing][rate_15m]" - the per-second event rate in a 15-minute sliding window
66
+ * "[thing][rate_1m]" - the per-second average value in a 1-minute sliding window
67
+ * "[thing][rate_5m]" - the per-second average value in a 5-minute sliding window
68
+ * "[thing][rate_15m]" - the per-second average value in a 15-minute sliding window
69
69
  * "[thing][min]" - the minimum value seen for this metric
70
70
  * "[thing][max]" - the maximum value seen for this metric
71
71
  * "[thing][stddev]" - the standard deviation for this metric
@@ -225,4 +225,4 @@ syntax: `timer => [ "name of metric", "%{time_value}" ]`
225
225
 
226
226
 
227
227
  [id="plugins-{type}s-{plugin}-common-options"]
228
- include::{include_path}/{type}.asciidoc[]
228
+ include::{include_path}/{type}.asciidoc[]
@@ -158,6 +158,8 @@ class LogStash::Filters::Metrics < LogStash::Filters::Base
158
158
  @last_flush = Atomic.new(0) # how many seconds ago the metrics where flushed.
159
159
  @last_clear = Atomic.new(0) # how many seconds ago the metrics where cleared.
160
160
  @random_key_preffix = SecureRandom.hex
161
+ # Same as logstash-input-file
162
+ @host = Socket.gethostname.force_encoding(Encoding::UTF_8)
161
163
  unless (@rates - [1, 5, 15]).empty?
162
164
  raise LogStash::ConfigurationError, "Invalid rates configuration. possible rates are 1, 5, 15. Rates: #{rates}."
163
165
  end
@@ -193,7 +195,7 @@ class LogStash::Filters::Metrics < LogStash::Filters::Base
193
195
  return unless should_flush?
194
196
 
195
197
  event = LogStash::Event.new
196
- event.set("message", Socket.gethostname)
198
+ event.set("message", @host)
197
199
  @metric_meters.each_pair do |name, metric|
198
200
  flush_rates event, name, metric
199
201
  metric.clear if should_clear?
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-metrics'
4
- s.version = '4.0.3'
4
+ s.version = '4.0.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "The metrics filter is useful for aggregating metrics."
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -42,6 +42,11 @@ describe LogStash::Filters::Metrics do
42
42
  end
43
43
  end
44
44
  end
45
+
46
+ it "should have host in message" do
47
+ insist { subject.length } == 1
48
+ reject { subject.first.get("message") }.nil?
49
+ end
45
50
  end
46
51
 
47
52
  context "on the second flush" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-23 00:00:00.000000000 Z
11
+ date: 2017-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement