fluent-plugin-statsd-output 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/VERSION +1 -1
- data/lib/fluent/plugin/out_statsd.rb +1 -1
- data/spec/plugin/multiple_placeholders_spec.rb +55 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cd9b0f7773c17c051439293fcfe14ce3e60cbd3
|
4
|
+
data.tar.gz: 3929c05cbb5e59c45aaddb932b884bfff9c015bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24e3bf9bc969f442d5b0fd5d0a3b8c82c5225858b34abfe357abd015a6f34522d3e08e2f440d07a5577aa56b0b2bcb22ec7906e04553e67b581418d098d6a1b8
|
7
|
+
data.tar.gz: ec042e836c84efd055fa70b859e7355b7d0776bc85bd18f9d23a09f35e9fd3c009d67ad22a0877d3419e08e1fa0055168b56fb71a41f98b204c73e6b09df2087
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.1
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'fluent/plugin/out_statsd'
|
2
|
+
require 'fluent/test'
|
3
|
+
|
4
|
+
RSpec.describe Fluent::StatsdOutput do
|
5
|
+
let(:config) do
|
6
|
+
%{
|
7
|
+
type statsd
|
8
|
+
|
9
|
+
<metric>
|
10
|
+
statsd_type increment
|
11
|
+
statsd_key res_code_${record['hostname']}_${record['status'].to_i / 100}xx
|
12
|
+
</metric>
|
13
|
+
}
|
14
|
+
end
|
15
|
+
let(:driver) { create_driver(config) }
|
16
|
+
let(:statsd) { double('statsd', increment: true,
|
17
|
+
flush: true,
|
18
|
+
'namespace=' => true,
|
19
|
+
'batch_size=' => true,
|
20
|
+
'batch_byte_size' => true)
|
21
|
+
|
22
|
+
}
|
23
|
+
let(:time) { Time.now.utc }
|
24
|
+
|
25
|
+
before :all do
|
26
|
+
Fluent::Test.setup
|
27
|
+
end
|
28
|
+
|
29
|
+
def create_driver(conf)
|
30
|
+
Fluent::Test::BufferedOutputTestDriver.new(Fluent::StatsdOutput) {
|
31
|
+
}.configure(conf)
|
32
|
+
end
|
33
|
+
|
34
|
+
def emit_events(events)
|
35
|
+
events.each {|e| driver.emit(e, time) }
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
it 'should call statsd with events data and correctly handle multiple placeholders' do
|
40
|
+
allow(Statsd).to receive(:new).and_return(statsd)
|
41
|
+
|
42
|
+
expect(statsd).to receive(:increment).with('res_code_localhost_2xx').twice.times
|
43
|
+
expect(statsd).to receive(:increment).with('res_code_localhost_4xx').once.times
|
44
|
+
expect(statsd).to receive(:increment).with('res_code_localhost_5xx').once.times
|
45
|
+
|
46
|
+
emit_events([
|
47
|
+
{'hostname' => 'localhost', 'response_time' => 102, 'status' => '200'},
|
48
|
+
{'hostname' => 'localhost', 'response_time' => 105, 'status' => '200'},
|
49
|
+
{'hostname' => 'localhost', 'response_time' => 112, 'status' => '400'},
|
50
|
+
{'hostname' => 'localhost', 'response_time' => 125, 'status' => '500'}
|
51
|
+
])
|
52
|
+
|
53
|
+
driver.run
|
54
|
+
end
|
55
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-statsd-output
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Song
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- VERSION
|
97
97
|
- fluent-plugin-statsd.gemspec
|
98
98
|
- lib/fluent/plugin/out_statsd.rb
|
99
|
+
- spec/plugin/multiple_placeholders_spec.rb
|
99
100
|
- spec/plugin/out_statsd_spec.rb
|
100
101
|
- spec/spec_helper.rb
|
101
102
|
homepage: https://github.com/lingochamp/fluent-plugin-statsd
|
@@ -122,5 +123,6 @@ signing_key:
|
|
122
123
|
specification_version: 4
|
123
124
|
summary: fluentd output filter plugin to send metrics to Esty StatsD
|
124
125
|
test_files:
|
126
|
+
- spec/plugin/multiple_placeholders_spec.rb
|
125
127
|
- spec/plugin/out_statsd_spec.rb
|
126
128
|
- spec/spec_helper.rb
|