fluent-plugin-jvm-gclog 0.0.3 → 0.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: 8e20f68ae80e55aa58c34118840d590038de7a1a
4
- data.tar.gz: e311efba5eb6a508dc6ec02eeb2f0b0bf0eb0bf5
3
+ metadata.gz: 114205623c7f88c66e050b65cf1adf057ab39904
4
+ data.tar.gz: ad69ca47d442b80ea0f95ae3cc452cfdd49c2ce8
5
5
  SHA512:
6
- metadata.gz: 5756178360f3c2b89c2da308f6b6092e84632f6b7a319153f8f08f86cc6cb8998b854a6f631c7d5bc61c290d8e580502db503a23f22f179ea6918693267badd0
7
- data.tar.gz: 3a76faa6bdfadea546ae0284c529774286e9038dde5cbf026ca8173bb3df69787799e5a102334a219547890b5cb4f14ed4bb3592c9474d211f6dc81c6cb0ee0a
6
+ metadata.gz: 47ea65473f80029c123adaa99aeb1e055635ed119fafef71cf95f4d22bc5ba09cc296aee2295136ee502b7d176dd31709ee2fbd8fda59bd6c074ef0af91214e0
7
+ data.tar.gz: 3e1cc125bea83864aa57511db91063920fc46eba948f86b8170bede0588a5a345f9d247743589d092d05481f1efdf414cdc155becfd24ad9563386978f52a8c5
data/README.md CHANGED
@@ -7,6 +7,10 @@ A fluentd plugin for gc.log of JavaVM
7
7
  % gem install fluent-plugin-jvm-gclog
8
8
  ```
9
9
 
10
+ This plugin use [jvm_gclog](https://github.com/stanaka/jvm_gclog) for parsing `gc.log`,
11
+ which `gc.log` is widely changed depending on javavm options.
12
+ See [README.md](https://github.com/stanaka/jvm_gclog/blob/master/README.md) about supporting options.
13
+
10
14
  ## Usage
11
15
 
12
16
  ```conf
@@ -14,8 +14,8 @@ Gem::Specification.new do |gem|
14
14
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
15
15
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
16
  gem.require_paths = ["lib"]
17
- gem.version = "0.0.3"
17
+ gem.version = "0.0.4"
18
18
  gem.add_development_dependency "rake"
19
19
  gem.add_runtime_dependency "fluentd"
20
- gem.add_runtime_dependency "jvm_gclog"
20
+ gem.add_runtime_dependency "jvm_gclog", ">= 0.0.2"
21
21
  end
@@ -25,33 +25,29 @@ class JVMGCLogInput < TailInput
25
25
  @hostname = `hostname -s`.strip
26
26
  end
27
27
 
28
- def convert_line_to_event(line, es)
29
- begin
30
- line.chomp! # remove \n
31
- record = @parser.parse(line)
32
- time = record.delete("time")
33
- record["host"] = @hostname
34
- if time && record
28
+ def parse_lines(lines)
29
+ es = MultiEventStream.new
30
+ chunks = @parser.recognize_chunks(lines)
31
+ records = @parser.parse_chunks(chunks)
32
+ records.each { |record|
33
+ begin
34
+ time = record.delete("time")
35
+ record["host"] = @hostname
36
+ if time && record
35
37
  es.add(time, record)
36
- else
37
- log.warn "pattern not match: #{line.inspect}"
38
+ else
39
+ log.warn "pattern not match: #{record.inspect}"
40
+ end
41
+ rescue => e
42
+ log.warn record, :error => e.to_s
43
+ log.debug_backtrace(e.backtrace)
38
44
  end
39
- rescue => e
40
- log.warn line.dump, :error => e.to_s
41
- log.debug_backtrace(e.backtrace)
42
- end
43
- end
44
-
45
- def parse_singleline(lines)
46
- es = MultiEventStream.new
47
- lines.each { |line|
48
- convert_line_to_event(line, es)
49
45
  }
50
46
  es
51
47
  end
52
48
 
53
49
  def receive_lines(lines, tail_watcher = nil)
54
- es = parse_singleline(lines)
50
+ es = parse_lines(lines)
55
51
  unless es.empty?
56
52
  tag = if @tag_prefix || @tag_suffix
57
53
  @tag_prefix + tail_watcher.tag + @tag_suffix
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-jvm-gclog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinji Tanaka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-08 00:00:00.000000000 Z
11
+ date: 2015-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.0.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 0.0.2
55
55
  description: Fluentd input plugin for JavaVM gc.log.
56
56
  email:
57
57
  - shinji.tanaka@gmail.com