fluent-plugin-top 0.1.0 → 0.1.1

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: 68d92f3f4a576246b36676c92c36d930a29512a2
4
- data.tar.gz: f171f9eb83e0999918432beb4a25c83b166347cd
3
+ metadata.gz: 78bc1f963e00712885cdaeb0d9981b0034edd076
4
+ data.tar.gz: 54e5f1b03daca72bd9e3dd20a3f54ffcc4165cd0
5
5
  SHA512:
6
- metadata.gz: 74c90f3744cce92369344c10a1db9090a7484bd75e7c837f08df2617fb3cd0ebcf33148d9e94d904d97a6662037930ae49f33982489cac9d90c45a308a791fcf
7
- data.tar.gz: 9b4019cfde8285e36f195e4d8ed92da80e6603e1214982d5631787790a7b0ffbf58c853d3160e46c6ad376bb6813e28abaeb5598eec6a7b22c5c4b41ef1241e5
6
+ metadata.gz: 13b95a6c01ff0eb430c62b6341e28ccfcc376704d4c9c7f8bdee5d51db86ceba01d7bbba46b6bdca2ad9ab879eec32d6c02ab9c8323bcb4b3340897fda4ecf6b
7
+ data.tar.gz: 3d78353d9fe2c630019e3ad16956db81688cffaa9731a61f93abe235ed2ce43eae84d29054fe9953904075ea40c06b29f421868acfa182ad9ac9609f804dab93
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  fluent-plugin-top
2
2
  ===
3
+ [![Gem Version](https://badge.fury.io/rb/fluent-plugin-top.svg)](https://badge.fury.io/rb/fluent-plugin-top)
4
+ [![Build Status](https://travis-ci.org/moccos/fluent-plugin-top.svg?branch=master)](https://travis-ci.org/moccos/fluent-plugin-top)
3
5
 
4
6
  Fluentd input plugin for top command.
5
7
 
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-top"
7
- spec.version = "0.1.0"
7
+ spec.version = "0.1.1"
8
8
  spec.authors = ["Tetsu Izawa (@moccos)"]
9
9
  spec.email = ["tt.izawa@gmail.com"]
10
10
  spec.homepage = "https://github.com/moccos/fluent-plugin-top"
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.required_ruby_version = '>=2.0'
21
22
  spec.add_development_dependency "bundler"
22
23
  spec.add_development_dependency "rake"
23
24
  spec.add_runtime_dependency "fluentd", ">= 0.12.0"
@@ -42,7 +42,7 @@ module Fluent
42
42
  begin
43
43
  pid, user, _pr, _ni, _virt, res, _shr, _s, cpu, mem, _time, cmd = ss
44
44
  args = ss.drop(12)
45
- return true, @@PS_INFO.new(pid.to_i, user, res, cpu.to_f, mem.to_f, cmd, args)
45
+ return true, @@PS_INFO.new(pid.to_i, user, parse_unit(res), cpu.to_f, mem.to_f, cmd, args)
46
46
  rescue => e
47
47
  $log.warn "parse error #{e.to_s}: " + line
48
48
  reset_state
@@ -62,12 +62,8 @@ module Fluent
62
62
  def parse_unit(s)
63
63
  begin
64
64
  case s[-1]
65
- when "m"
66
- s[0, s.length-1].to_f * 1024
67
- when "g"
68
- s[0, s.length-1].to_f * 1024 * 1024
69
- #when "t" # I've never seen...
70
- #s[0, s.length-1].to_f * 1024 * 1024 * 1024
65
+ when "g" # gibibyte
66
+ (s[0, s.length-1].to_f * 1024 * 1024).to_i
71
67
  else
72
68
  s.to_i
73
69
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-top
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tetsu Izawa (@moccos)
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-14 00:00:00.000000000 Z
11
+ date: 2016-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -74,6 +74,7 @@ extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
+ - ".travis.yml"
77
78
  - Gemfile
78
79
  - LICENSE.txt
79
80
  - README.md
@@ -94,7 +95,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
94
95
  requirements:
95
96
  - - ">="
96
97
  - !ruby/object:Gem::Version
97
- version: '0'
98
+ version: '2.0'
98
99
  required_rubygems_version: !ruby/object:Gem::Requirement
99
100
  requirements:
100
101
  - - ">="