fluent-plugin-nostat 0.2.1 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90b76a3a63ad5b11308798732e0d9478ec4f5901
4
- data.tar.gz: c4af4b9b7d642605cb4878ed627dae32211a85c8
3
+ metadata.gz: adb9723e09a8c8d72c37e879160d87507eb5c2af
4
+ data.tar.gz: e4d25706b838d2a459edc60d3a41fda9a1d8ec14
5
5
  SHA512:
6
- metadata.gz: 3d60fe29f11d1ecb8dfaa4d3016553ea33f5c4f5843ff8dc3f531142f167d5d9b9b75cad76e6b0c1387eb5042e284f082a05852e0b3bb3b7a9f169951345c7a5
7
- data.tar.gz: 00acffadc1a169db0364548e4958c27f19de0536e81c6c3f3452147ef3c66454f1e9f05318a6830b62838bb6cc209a880a931bad4bf405b7bcf3ee3e72c3f938
6
+ metadata.gz: a0a4637297f9a80159f91b445f6d00a0bed034a1875d77eb5ce566cd2bea37906e3c90a0e5a71dcf63bc96eaabedac4b60a6d300f0f53b171229f598ec11121b
7
+ data.tar.gz: cd941c68a854becaec13911e32002c62fae721f2cbfff661e726a22082acc185f60821a383273aa11020ffad9f329b68a38f71d1100770af6b16842384688d03
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # fluent-plugin-nostat
2
- fluent plugin for system resource monitoring whithout dstat
2
+ [fluentd](http://www.fluentd.org/) plugin for system resource monitoring whithout dstat
3
3
 
4
4
  ## Installation
5
5
  install with gem command as:
@@ -46,6 +46,11 @@ cpu={"usr"=>0, "sys"=>0, "idl"=>100, "wai"=>0, "siq"=>0, "hiq"=>0} mem={"free"=>
46
46
  ```
47
47
 
48
48
  ### graphite output style
49
+ graphite output type is for [fluent-plugin-graphite](https://github.com/studio3104/fluent-plugin-graphite). To use this output type, graphite plugin should be installed by following command. There is no dependancy for that plugin yet.
50
+ ```
51
+ gem install fluent-plugin-graphite
52
+ ```
53
+
49
54
  * full configuration example
50
55
  ```
51
56
  <source>
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: fluent-plugin-nostat 0.2.1 ruby lib
2
+ # stub: fluent-plugin-nostat 0.2.2 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "fluent-plugin-nostat"
6
- s.version = "0.2.1"
6
+ s.version = "0.2.2"
7
7
 
8
8
  s.require_paths = ["lib"]
9
9
  s.authors = ["No JinHo"]
@@ -122,7 +122,6 @@ module Fluent
122
122
 
123
123
  def get_net_stat
124
124
  res = {}
125
- net = {}
126
125
 
127
126
  File.foreach(@@NET_STAT).with_index do |line, index|
128
127
  if ( index < 2 )
@@ -136,10 +135,13 @@ module Fluent
136
135
  next
137
136
  end
138
137
 
138
+ net = {}
139
+
139
140
  net["recv"] = items[1].strip.to_i
140
141
  net["send"] = items[9].strip.to_i
141
142
 
142
143
  res[name] = net
144
+
143
145
  end
144
146
 
145
147
  res
@@ -175,9 +177,9 @@ module Fluent
175
177
 
176
178
  def get_dstat_disk (disk_stat)
177
179
  res = {}
178
- disk = {}
179
180
 
180
181
  disk_stat.each do |key, value|
182
+ disk = {}
181
183
  disk["read"] = (((value["read"] - @@history["disk"][key]["read"]) * @@LINUX_SECTOR_SIZE_BYTE) / @run_interval).ceil
182
184
  disk["write"] = (((value["write"] - @@history["disk"][key]["write"]) * @@LINUX_SECTOR_SIZE_BYTE) / @run_interval).ceil
183
185
  res[key] = disk
@@ -188,9 +190,9 @@ module Fluent
188
190
 
189
191
  def get_dstat_net (net_stat)
190
192
  res = {}
191
- net = {}
192
193
 
193
194
  net_stat.each do |key, value|
195
+ net = {}
194
196
  net["recv"] = (((value["recv"] - @@history["net"][key]["recv"])) / @run_interval).ceil
195
197
  net["send"] = (((value["send"] - @@history["net"][key]["send"])) / @run_interval).ceil
196
198
  res[key] = net
@@ -274,7 +276,6 @@ module Fluent
274
276
  time = Engine.now
275
277
 
276
278
  emit_record(time,record)
277
-
278
279
  rescue => e
279
280
  log.error "nostat failed to emit", :error => e.to_s, :error_class => e.class.to_s, :tag => tag
280
281
  log.error "nostat to run or shutdown child process", :error => $!.to_s, :error_class => $!.class.to_s
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-nostat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - No JinHo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-11 00:00:00.000000000 Z
11
+ date: 2016-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd