fluent-plugin-jvmwatcher 0.1.3 → 0.1.4
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.
- data/ChangeLog +11 -0
- data/README.md +55 -21
- data/VERSION +1 -0
- data/fluent-plugin-jvmwatcher.gemspec +2 -2
- data/lib/fluent/plugin/jvmwatcher_util.rb +14 -16
- metadata +6 -4
data/ChangeLog
ADDED
data/README.md
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
Java VM status input plugin for Fluent
|
2
2
|
====
|
3
3
|
fluent-plugin-jvmwatcher is input plugin which collects the CPU usage rate and the memory usage of more than one JavaVM, information on GC to the constant period.
|
4
|
+
The collection of the CPU usage rate and the memory usage, the information on GC goes in JVMWatcher from JavaVM.
|
5
|
+
fluent-plugin-jvmwatcher is collecting the condition of JavaVM in summoning JVMWatcher from inside.
|
4
6
|
|
5
|
-
fluent-plugin-jvmwatcherは、複数のJavaVMの、CPU使用率やメモリ使用量、GCの情報を、一定周期に収集するinput pluginです。
|
7
|
+
fluent-plugin-jvmwatcherは、複数のJavaVMの、CPU使用率やメモリ使用量、GCの情報を、一定周期に収集するinput pluginです。
|
8
|
+
JavaVMから、CPU使用率やメモリ使用量、GCの情報の収集は、JVMWatcherで行っています。
|
9
|
+
fluent-plugin-jvmwatcherは、内部からJVMWatcherを呼び出すことで、JavaVMの状態を収集しています。
|
10
|
+
|
11
|
+
JVMWatcher -> <https://github.com/MasayukiMiyake97/JVMWatcher>
|
6
12
|
|
7
13
|
## Installation
|
8
14
|
|
@@ -24,7 +30,18 @@ Then fluent automatically loads the plugin installed.
|
|
24
30
|
tag jvmwatcher.log
|
25
31
|
</source>
|
26
32
|
|
27
|
-
|
33
|
+
1. log_interval <- It is the interval by which the condition is acquired from JavaVM(The millisecond unit).
|
34
|
+
2. log_buff_num <- It is the collection number of times of the log which outputs log outside.
|
35
|
+
3. jvm_refind_interval <- It is the interval which updates JavaVM of the collection object(The millisecond unit).This value doesn't set an extremely short value.Make 10000 ( msec ) a standard even if it is short.
|
36
|
+
4. filter_config_path <- filtering Configuration file name.The definition with this item isn't indispensable.
|
37
|
+
|
38
|
+
## filtering Configuration file
|
39
|
+
When wanting to limit the Java process to measure only to the specific process, create the file which defined the process name to limit by the regular expression.
|
40
|
+
Create this definition file in the file with the JSON format which is in the following example.
|
41
|
+
|
42
|
+
もし、計測するJavaプロセスを、特定のプロセスだけに限定したい場合は、限定するプロセス名称を正規表現で定義したファイルを作成してください。この定義ファイルは、次の例にあるJSONフォーマットのファイルで作成してください。
|
43
|
+
|
44
|
+
filter_config.json
|
28
45
|
|
29
46
|
{"target" :
|
30
47
|
[
|
@@ -33,6 +50,9 @@ Then fluent automatically loads the plugin installed.
|
|
33
50
|
]
|
34
51
|
}
|
35
52
|
|
53
|
+
1. shortname <- It sets the simple name of the process.
|
54
|
+
2. pattern <- It sets the regular expression to limit a process.
|
55
|
+
|
36
56
|
There is a sample of the command which outputs the list of the Java process under the directory of fluent-plugin-jvmwatcher which was installed in gem and the definition file of filtering.
|
37
57
|
|
38
58
|
gemでインストールした、fluent-plugin-jvmwatcherのディレクトリの下に、Javaプロセスの一覧を出力するコマンドと、フィルタリングの定義ファイルのサンプルがあります。
|
@@ -52,11 +72,11 @@ gemでインストールした、fluent-plugin-jvmwatcherのディレクトリ
|
|
52
72
|
|
53
73
|
|
54
74
|
###Java process listup.
|
55
|
-
Before creating the definition file of filtering, it executes JvmProcCheck.sh command and it makes output the list of the Java process which is working on the host.
|
56
|
-
It finds the character string which suited the key word to use for the regular expression to set to "pattern" from the name of the Java process which is output by [ CommandLine ] of the list.
|
75
|
+
Before creating the definition file of filtering, it executes JvmProcCheck.sh command and it makes output the list of the Java process which is working on the host.
|
76
|
+
It finds the character string which suited the key word to use for the regular expression to set to "pattern" from the name of the Java process which is output by [ CommandLine ] of the list.
|
57
77
|
|
58
|
-
フィルタリングの定義ファイルを作成する前に、JvmProcCheck.shコマンドを実行して、ホスト上で動作しているJavaプロセスの一覧を出力させます。
|
59
|
-
一覧の[CommandLine]に出力されるJavaプロセスの名称から、"pattern"に設定する正規表現に使用するキーワードに適した文字列を、見つけ出します。
|
78
|
+
フィルタリングの定義ファイルを作成する前に、JvmProcCheck.shコマンドを実行して、ホスト上で動作しているJavaプロセスの一覧を出力させます。
|
79
|
+
一覧の[CommandLine]に出力されるJavaプロセスの名称から、"pattern"に設定する正規表現に使用するキーワードに適した文字列を、見つけ出します。
|
60
80
|
|
61
81
|
cd lib/fluent/plugin/jvmwatcher/bin
|
62
82
|
./JvmProcCheck.sh
|
@@ -72,13 +92,13 @@ Output
|
|
72
92
|
-- process list end --
|
73
93
|
|
74
94
|
###Java process filtering check.
|
75
|
-
Create the definition file of filtering from the found key word and preserve it under config.
|
76
|
-
It executes JvmProcCheck.sh command and it confirms that only a Java process for the purpose is done by filtering by the definition file of created filtering.
|
77
|
-
The way of confirming set the definition file of created filtering to the argument of the JvmProcCheck.sh command and execute it.
|
95
|
+
Create the definition file of filtering from the found key word and preserve it under config.
|
96
|
+
It executes JvmProcCheck.sh command and it confirms that only a Java process for the purpose is done by filtering by the definition file of created filtering.
|
97
|
+
The way of confirming set the definition file of created filtering to the argument of the JvmProcCheck.sh command and execute it.
|
78
98
|
|
79
|
-
見つけ出したキーワードから、フィルタリングの定義ファイルを作成し、configの下に保存して下さい。
|
80
|
-
作成したフィルタリングの定義ファイルによって、目的のJavaプロセスだけがフィルタリングされることは、JvmProcCheck.shコマンドを実行して確認します。
|
81
|
-
確認方法は、作成したフィルタリングの定義ファイルを、JvmProcCheck.shコマンドの引数に設定して、実行してください。
|
99
|
+
見つけ出したキーワードから、フィルタリングの定義ファイルを作成し、configの下に保存して下さい。
|
100
|
+
作成したフィルタリングの定義ファイルによって、目的のJavaプロセスだけがフィルタリングされることは、JvmProcCheck.shコマンドを実行して確認します。
|
101
|
+
確認方法は、作成したフィルタリングの定義ファイルを、JvmProcCheck.shコマンドの引数に設定して、実行してください。
|
82
102
|
|
83
103
|
./JvmProcCheck.sh ../config/filter_config.json
|
84
104
|
|
@@ -92,16 +112,16 @@ Output
|
|
92
112
|
|
93
113
|
|
94
114
|
##JVM status log sample
|
95
|
-
It is the sample of the log which was output from jvmwatcher.
|
96
|
-
This sample is outputting only a necessary Java process using filter_config_path of the configuration.
|
97
|
-
The name to set to "shortname" of the definition file of filtering is output by "name" of the output log.
|
98
|
-
When not using filter_config_path of the configuration, the contents which are the same as "display_name" are output by "shortname".
|
99
|
-
Also, the log of all Java processes of the node is output.
|
115
|
+
It is the sample of the log which was output from jvmwatcher.
|
116
|
+
This sample is outputting only a necessary Java process using filter_config_path of the configuration.
|
117
|
+
The name to set to "shortname" of the definition file of filtering is output by "name" of the output log.
|
118
|
+
When not using filter_config_path of the configuration, the contents which are the same as "display_name" are output by "shortname".
|
119
|
+
Also, the log of all Java processes of the node is output.
|
100
120
|
|
101
|
-
jvmwatcherから出力されたログのサンプルです。
|
102
|
-
このサンプルは、コンフィグレーションのfilter_config_pathを使用して、必要なJavaプロセスだけを出力しています。
|
103
|
-
出力されているログの"name"には、フィルタリングの定義ファイルの"shortname"に設定している名称が出力されます。
|
104
|
-
コンフィグレーションのfilter_config_pathを使用しない場合は、"shortname"に"display_name"と同じ内容が出力されます。また、ノードのすべてのJavaプロセスのログが出力されます。
|
121
|
+
jvmwatcherから出力されたログのサンプルです。
|
122
|
+
このサンプルは、コンフィグレーションのfilter_config_pathを使用して、必要なJavaプロセスだけを出力しています。
|
123
|
+
出力されているログの"name"には、フィルタリングの定義ファイルの"shortname"に設定している名称が出力されます。
|
124
|
+
コンフィグレーションのfilter_config_pathを使用しない場合は、"shortname"に"display_name"と同じ内容が出力されます。また、ノードのすべてのJavaプロセスのログが出力されます。
|
105
125
|
|
106
126
|
2013-05-11T13:53:50+09:00 jvmwatcher.log {"logtime":1368248030423,"host_name":"nanoha","proc_state":"START_PROCESS","pid":2677,"name":"Tomcat","display_name":"org.apache.catalina.startup.Bootstrap start","start_time":1368235715885,"up_time":12314590,"cpu_usage":0.13756041,"compile_time":2280,"c_load_cnt":2110,"c_unload_cnt":0,"c_total_load_cnt":2111,"th_cnt":15,"daemon_th_cnt":14,"peak_th_cnt":15,"heap_init":62766272,"heap_used":14218752,"heap_commit":60227584,"heap_max":892928000,"notheap_init":24313856,"notheap_used":18505232,"notheap_commit":31784960,"notheap_max":224395264,"pending_fin_cnt":0,"total_phy_mem_size":4017041408,"total_swap_mem_size":4160741376,"free_phy_mem_size":1830621184,"free_swap_mem_size":4160741376,"commit_vmem_size":2432827392,"gc_collect":[{"gc_mgr_name":"PS MarkSweep","gc_coll_cnt":4,"gc_coll_time":159},{"gc_mgr_name":"PS Scavenge","gc_coll_cnt":7,"gc_coll_time":44}]}
|
107
127
|
2013-05-11T13:53:51+09:00 jvmwatcher.log {"logtime":1368248031423,"host_name":"nanoha","proc_state":"LIVE_PROCESS","pid":2677,"name":"Tomcat","display_name":"org.apache.catalina.startup.Bootstrap start","start_time":1368235715885,"up_time":12315551,"cpu_usage":4.162331,"compile_time":2334,"c_load_cnt":2153,"c_unload_cnt":0,"c_total_load_cnt":2153,"th_cnt":15,"daemon_th_cnt":14,"peak_th_cnt":15,"heap_init":62766272,"heap_used":15915928,"heap_commit":60227584,"heap_max":892928000,"notheap_init":24313856,"notheap_used":18749552,"notheap_commit":31784960,"notheap_max":224395264,"pending_fin_cnt":0,"total_phy_mem_size":4017041408,"total_swap_mem_size":4160741376,"free_phy_mem_size":1805737984,"free_swap_mem_size":4160741376,"commit_vmem_size":2432827392,"gc_collect":[{"gc_mgr_name":"PS MarkSweep","gc_coll_cnt":4,"gc_coll_time":159},{"gc_mgr_name":"PS Scavenge","gc_coll_cnt":7,"gc_coll_time":44}]}
|
@@ -113,3 +133,17 @@ jvmwatcherから出力されたログのサンプルです。
|
|
113
133
|
In the date and time which is output at the head of the log, it is generating from "logtime" which is the time by which the information was acquired actually from JavaVM.
|
114
134
|
|
115
135
|
ログの先頭に出力されている日時は、実際にJavaVMから情報を取得した時間である"logtime"から生成しています。
|
136
|
+
|
137
|
+
log output format <https://github.com/MasayukiMiyake97/fluent-plugin-jvmwatcher/wiki/Log-outout-format>
|
138
|
+
|
139
|
+
##Requirements
|
140
|
+
JDK >= 1.6
|
141
|
+
|
142
|
+
* On the Linux ( CentOS ), it is OpenJDK In 1.6 pieces of environment, it is doing an operations check.The operations check doesn't go but probably, it works on Ubuntu.
|
143
|
+
* fluent-plugin-jvmwatcher is using tools.jar which JDK is providing.Therefore, in the JRE environment which tools.jar isn't contained in, it doesn't work.Certainly, use in the environment which JDK is installed in.
|
144
|
+
|
145
|
+
##Copyright
|
146
|
+
Copyright (c) 2013 MasayukiMiyake
|
147
|
+
|
148
|
+
##License
|
149
|
+
Apache License, Version 2.0
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
v0.1.4
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = "fluent-plugin-jvmwatcher"
|
6
|
-
gem.version = "0.1.
|
6
|
+
gem.version = "0.1.4"
|
7
7
|
gem.authors = ["MasayukiMiyake"]
|
8
8
|
gem.email = ["masayukimiyake97@gmail.com"]
|
9
9
|
gem.description = %q{It is the input plugin of fluentd which collects the condition of Java VM.}
|
@@ -15,28 +15,26 @@ module JvmwatcherUtil
|
|
15
15
|
|
16
16
|
java_path = nil
|
17
17
|
|
18
|
+
# find java command path
|
18
19
|
$LOAD_PATH.map do |load_path|
|
19
20
|
path = File.join(load_path, "fluent/plugin") # make fluentd plugin path
|
20
21
|
if File.directory?(path)
|
21
22
|
|
22
|
-
# find target directory
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
break if java_path
|
23
|
+
# find target java directory
|
24
|
+
path_name = "#{path}/jvmwatcher/#{dir_name}"
|
25
|
+
|
26
|
+
next unless File.directory?(path_name) # chech directory
|
27
|
+
|
28
|
+
if file_name
|
29
|
+
# check file
|
30
|
+
java_path = File.join(path_name, file_name)
|
31
|
+
java_path = nil unless File.file?(java_path)
|
32
|
+
else
|
33
|
+
java_path = path_name
|
36
34
|
end
|
37
|
-
end
|
38
35
|
|
39
|
-
|
36
|
+
break if java_path
|
37
|
+
end
|
40
38
|
end
|
41
39
|
|
42
40
|
return java_path
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-jvmwatcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -52,10 +52,12 @@ extensions: []
|
|
52
52
|
extra_rdoc_files: []
|
53
53
|
files:
|
54
54
|
- .gitignore
|
55
|
+
- ChangeLog
|
55
56
|
- Gemfile
|
56
57
|
- LICENSE.txt
|
57
58
|
- README.md
|
58
59
|
- Rakefile
|
60
|
+
- VERSION
|
59
61
|
- fluent-plugin-jvmwatcher.gemspec
|
60
62
|
- lib/fluent/plugin/in_jvmwatcher.rb
|
61
63
|
- lib/fluent/plugin/jvmwatcher/bin/JvmProcCheck.sh
|
@@ -88,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
90
|
version: '0'
|
89
91
|
segments:
|
90
92
|
- 0
|
91
|
-
hash: -
|
93
|
+
hash: -1794146933402571690
|
92
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
95
|
none: false
|
94
96
|
requirements:
|
@@ -97,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
99
|
version: '0'
|
98
100
|
segments:
|
99
101
|
- 0
|
100
|
-
hash: -
|
102
|
+
hash: -1794146933402571690
|
101
103
|
requirements: []
|
102
104
|
rubyforge_project: fluent-plugin-jvmwatcher
|
103
105
|
rubygems_version: 1.8.25
|