fluent-plugin-nostat 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 922ef03c57c93b3ad21ff995306ccd54c24ded89
4
- data.tar.gz: 8576dc90677a7631c1d635424383ccb6bb64875f
3
+ metadata.gz: bd29b9aae14064c027767a9f27d9012ee7d811bd
4
+ data.tar.gz: cafc6d0346c83f591b05f229a3dd80f4b640451c
5
5
  SHA512:
6
- metadata.gz: 495da10e373f368cbc42aea78f6e930f557e8e0cdd8a9786ade181cc44f7b2f71291fd12dcec57cb7404ecc1dadf0b881fe965f5fba3ec3986eb883a15ec32af
7
- data.tar.gz: 7ae64e502d3bf8172e3f4da11d5a493585f1b740fa87f47d644e1a9641b70d16bd5e29bfd2faee030488540a5df314e1aaf134e032045831fa87e2ad7f70d94c
6
+ metadata.gz: 2644490f692a735634fbe12b71d120b81e4204e81976ef5464f931095308bf4de130cf2854c8c0d3e353f7578973efc3b500b5ced474e97d3d02b7856100f0be
7
+ data.tar.gz: f516112e839b9cf2e4339d28f1f1e354afc4420414e68aca51df0ff634a0e745f9bddd8f8c2b12a5423094fddb06311c1267e6a0b140e0216f35486aa59ad771
data/README.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # fluent-plugin-nostat
2
2
  fluent plugin for system resource monitoring whithout dstat
3
3
 
4
- # it was tested on
4
+ ## Installation
5
+ install with gem command as:
6
+
7
+ ```
8
+ $ gem install fluent-plugin-nostat
9
+ ```
10
+
11
+ ## configuration
12
+
13
+ ```
14
+ <source>
15
+ type nostat
16
+ run_interval 1
17
+ </source>
18
+ ```
19
+
20
+ ## output
21
+ the raw stats from /proc directory.
22
+ * cpu : time - http://www.linuxhowtos.org/System/procstat.htm
23
+ * memory : KB - https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s2-proc-meminfo.html
24
+ * disk : sector - https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats
25
+ * network : bytes - http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html
26
+
27
+ ```
28
+ cpu={"usr"=>52773, "sys"=>28330, "idl"=>2217987, "wai"=>1995, "siq"=>4112, "hiq"=>0} disk={"sda"=>{"read"=>"9786551", "write"=>"29250018"}} net={"enp0s3"=>{"recv"=>8940623796, "send"=>383889456}, "enp0s8"=>{"recv"=>8940623796, "send"=>383889456}} mem={"total"=>1884188, "free"=>67968, "buff"=>0, "cach"=>1546820, "used"=>269400}
29
+ ```
30
+
31
+ ## it was tested on
5
32
  . CentOS 7.x (kernel 3.10.x)
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "fluent-plugin-nostat"
6
- s.version = "0.0.2"
6
+ s.version = "0.0.3"
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"]
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  "lib/fluent/plugin/in_nostat.rb",
24
24
  ]
25
25
  s.homepage = "http://github.com/nozino/fluent-plugin-nostat"
26
- s.rubygems_version = "2.4.5"
26
+ s.rubygems_version = "2.0.14"
27
27
  s.summary = "Linux Resource Monitoring Input plugin for Fluent event collector"
28
28
 
29
29
  if s.respond_to? :specification_version then
@@ -7,18 +7,18 @@ module Fluent
7
7
  @@DISK_STAT = "/proc/diskstats"
8
8
  @@NET_STAT = "/proc/net/dev"
9
9
 
10
- @@CPU_USR = 0
11
- @@CPU_SYS = 2
12
- @@CPU_IDL = 3
13
- @@CPU_WAI = 4
14
- @@CPU_SIQ = 6
15
- @@CPU_HIQ = 5
10
+ @@CPU_USR = 1
11
+ @@CPU_SYS = 3
12
+ @@CPU_IDL = 4
13
+ @@CPU_WAI = 5
14
+ @@CPU_HIQ = 6
15
+ @@CPU_SIQ = 7
16
16
 
17
17
  def initialize
18
18
  super
19
19
  require 'fluent/timezone'
20
20
  end
21
-
21
+ n
22
22
  config_param :tag_prefix, :string, :default => nil
23
23
  config_param :tag, :string, :default => nil
24
24
  config_param :run_interval, :time, :default => nil
@@ -119,8 +119,8 @@ module Fluent
119
119
  next
120
120
  end
121
121
 
122
- net["recv"] = items[1]
123
- net["send"] = items[9]
122
+ net["recv"] = items[1].strip.to_i
123
+ net["send"] = items[9].strip.to_i
124
124
 
125
125
  res[name] = net
126
126
  end
@@ -140,8 +140,6 @@ module Fluent
140
140
  record["net"] = get_net_stat
141
141
  record["mem"] = get_mem_stat
142
142
 
143
- log.info "ret=", record
144
-
145
143
  emit_tag = @tag.dup
146
144
  time = Engine.now
147
145
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-nostat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - No JinHo