fluent-plugin-sadf 0.0.1 → 0.0.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: 21809ec9dde43b541c62ab1027b13c13f267852e
4
- data.tar.gz: 90c017dced717ca77c9f35c74c03fae4eee8918b
3
+ metadata.gz: 12a2d14b265941dde4337e183c26f218d0898f5d
4
+ data.tar.gz: c981ea782005f8d0cfffa9f97ef9ed26b4ebf7b9
5
5
  SHA512:
6
- metadata.gz: 47b5a768bb9706524a0c4451e05bbfc89c7b0e511cabf30d0e144197951c3fce4fd9bc2c1eef1dc5f0fd4cfefea1c585752420191ffdbe5fd0b83a6993ee06be
7
- data.tar.gz: 4ec9d9cd2ef03df54400f9bf55637282123de9fabbf974feb18e0b90a46b8765e5e2207791b3f5187cf6a03bb2a499f5f4445b9121bf5cbd5973b9fb021bacd1
6
+ metadata.gz: 7b64b1f87ef675939181516b8400897208411dc34482432682c39e105844e973e86a31f291a062b9d88fce4ffd0761a9b5c00994d652b7bab9d0a6d42b10e986
7
+ data.tar.gz: 6ff4829f9deedd65120e8c630ab9ffcf3334aec1230f54adbfe54229a546317202cc47effb356e2700ce84ed7b12f1ebf2dff6338480fd3b8a26b9f519efccd5
data/README.md CHANGED
@@ -28,6 +28,16 @@ output
28
28
 
29
29
  sadf.tag: {"hostname":"note","args":"-A","all":{"%usr":"26.14","%nice":"0.00","%sys":"7.95","%iowait":"1.96","%steal":"0.00","%irq":"0.00","%soft":"0.00","%guest":"0.00","%gnice":"0.00","%idle":"63.94"},"cpu0":{"%usr":"21.40","%nice":"0.00","%sys":"8.73","%iowait":"3.93","%steal":"0.00","%irq":"0.00","%soft":"0.00","%guest":"0.00","%gnice":"0.00","%idle":"65.94"},"cpu1":{"%usr":"35.81","%nice":"0.00","%sys":"9.61","%iowait":"2.18","%steal":"0.00","%irq":"0.00","%soft":"0.00","%guest":"0.00","%gnice":"0.00","%idle":"52.40"},"cpu2":{"%usr":"21.40","%nice":"0.00","%sys":"6.55","%iowait":"1.75","%steal":"0.00","%irq":"0.00","%soft":"0.00","%guest":"0.00","%gnice":"0.00","%idle":"70.31"},"cpu3":{"%usr":"25.97","%nice":"0.00","%sys":"6.93","%iowait":"0.00","%steal":"0.00","%irq":"0.00","%soft":"0.00","%guest":"0.00","%gnice":"0.00","%idle":"67.10"}}
30
30
 
31
+ ## Change
32
+
33
+ ### 0.0.2
34
+
35
+ fix bug (this could not collect latest performances. (this plugin was collecting OLDEST performances.))
36
+
37
+ ### 0.0.1
38
+
39
+ first version
40
+
31
41
  ## Copyright
32
42
 
33
43
  Copyright (c) 2016 Yuji Hagiwara. See [LICENSE](LICENSE.txt) for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -1,3 +1,5 @@
1
+ require 'tempfile'
2
+
1
3
  class SadfInput < Fluent::Input
2
4
  Fluent::Plugin.register_input('sadf', self)
3
5
 
@@ -41,12 +43,15 @@ class SadfInput < Fluent::Input
41
43
  def sadf_execute(opt)
42
44
  rec = Hash.new
43
45
 
44
- `LANG=C sadf -- #{opt} 1 1`.split("\n").each {| line |
45
- array = line.split("\t")
46
- if !rec.has_key?(array[3]) then
47
- rec[array[3]] = Hash.new
48
- end
49
- rec[array[3]][array[4]] = array[5]
46
+ Tempfile.open('sar') {|tmpfile|
47
+ `LANG=C sar -o #{tmpfile.path} 1 1`
48
+ `LANG=C sadf -- #{opt} 1 1 #{tmpfile.path}`.split("\n").each {| line |
49
+ array = line.split("\t")
50
+ if !rec.has_key?(array[3]) then
51
+ rec[array[3]] = Hash.new
52
+ end
53
+ rec[array[3]][array[4]] = array[5]
54
+ }
50
55
  }
51
56
 
52
57
  rec
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-sadf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - yuuzi41
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-19 00:00:00.000000000 Z
11
+ date: 2016-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd