fluent-plugin-dstat 0.3.1 → 0.3.2
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/Rakefile +9 -0
- data/VERSION +1 -1
- data/fluent-plugin-dstat.gemspec +2 -2
- data/lib/fluent/plugin/in_dstat.rb +21 -1
- data/test/plugin/test_in_dstat.rb +9 -5
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da7754b1412274c5b20c0fdd8090f141e45ee5c4
|
4
|
+
data.tar.gz: a1fdcaaa0583d70f1c4aaca6ba6f9538aadda82d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bee0b4b8a2139f84eceff5d3941529db3ca17e2330d10b013efb30692c0646528f98e0f8dedf02005cdad6ad50a9c4d20b7c0cdd396bf5fdd16f29e8fc7d026
|
7
|
+
data.tar.gz: df21f44396dd13cce329b12e0437e8dd1653c8808223a163d1c731da8b7505436bd31db71179c439936195c1ffa0f1cd1294487e60ab0cbe3dd741b32e75b21e
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
data/fluent-plugin-dstat.gemspec
CHANGED
@@ -3,13 +3,14 @@
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-dstat"
|
6
|
-
s.version = "0.3.
|
6
|
+
s.version = "0.3.2"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
10
10
|
s.authors = ["Shunsuke Mikami"]
|
11
11
|
s.date = "2015-08-15"
|
12
12
|
s.email = "shun0102@gmail.com"
|
13
|
+
s.license = "Apache-2.0"
|
13
14
|
s.extra_rdoc_files = [
|
14
15
|
"LICENSE.txt",
|
15
16
|
"README.md"
|
@@ -55,4 +56,3 @@ Gem::Specification.new do |s|
|
|
55
56
|
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
56
57
|
end
|
57
58
|
end
|
58
|
-
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'fluent/input'
|
1
2
|
require 'fluent/mixin/rewrite_tag_name'
|
2
3
|
|
3
4
|
module Fluent
|
@@ -17,11 +18,25 @@ module Fluent
|
|
17
18
|
@last_time = Time.now
|
18
19
|
end
|
19
20
|
|
21
|
+
# For fluentd v0.12.16 or earlier
|
22
|
+
class << self
|
23
|
+
unless method_defined?(:desc)
|
24
|
+
def desc(description)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
desc "supported ${hostname} placeholder powered by Fluent::Mixin::RewriteTagName"
|
20
30
|
config_param :tag, :string
|
31
|
+
desc "dstat command path"
|
21
32
|
config_param :dstat_path, :string, :default => "dstat"
|
33
|
+
desc "dstat command line option"
|
22
34
|
config_param :option, :string, :default => "-fcdnm"
|
35
|
+
desc "Run dstat command every `delay` seconds"
|
23
36
|
config_param :delay, :integer, :default => 1
|
37
|
+
desc "Write dstat result to this file"
|
24
38
|
config_param :tmp_file, :string, :default => "/tmp/dstat.csv"
|
39
|
+
desc "hostname command path"
|
25
40
|
config_param :hostname_command, :string, :default => "hostname"
|
26
41
|
|
27
42
|
include Fluent::Mixin::RewriteTagName
|
@@ -70,7 +85,12 @@ module Fluent
|
|
70
85
|
|
71
86
|
def restart
|
72
87
|
Process.detach(@pid)
|
73
|
-
|
88
|
+
begin
|
89
|
+
Process.kill(:TERM, @pid)
|
90
|
+
rescue Errno::ESRCH => e
|
91
|
+
$log.error "unexpected death of a child process", :error=>e.to_s
|
92
|
+
$log.error_backtrace
|
93
|
+
end
|
74
94
|
@dw.detach
|
75
95
|
@tw.detach
|
76
96
|
@line_number = 0
|
@@ -28,13 +28,17 @@ class DstatInputTest < Test::Unit::TestCase
|
|
28
28
|
assert_equal 1, d.instance.delay
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
data do
|
32
|
+
hash = {}
|
33
33
|
OPTIONS.each do |op|
|
34
|
-
|
35
|
-
emit_with_conf(conf)
|
34
|
+
hash[op] = op
|
36
35
|
end
|
37
|
-
|
36
|
+
hash
|
37
|
+
end
|
38
|
+
def test_emit(data)
|
39
|
+
op = data
|
40
|
+
conf = "tag dstat\n option --#{op}\n delay 1"
|
41
|
+
emit_with_conf(conf)
|
38
42
|
end
|
39
43
|
|
40
44
|
def emit_with_conf(conf)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-dstat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shunsuke Mikami
|
@@ -106,7 +106,8 @@ files:
|
|
106
106
|
- test/helper.rb
|
107
107
|
- test/plugin/test_in_dstat.rb
|
108
108
|
homepage: http://github.com/shun0102/fluent-plugin-dstat
|
109
|
-
licenses:
|
109
|
+
licenses:
|
110
|
+
- Apache-2.0
|
110
111
|
metadata: {}
|
111
112
|
post_install_message:
|
112
113
|
rdoc_options: []
|
@@ -124,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
125
|
version: '0'
|
125
126
|
requirements: []
|
126
127
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.5.1
|
128
129
|
signing_key:
|
129
130
|
specification_version: 4
|
130
131
|
summary: Dstat Input plugin for Fluent event collector
|