Permalink
Browse files

Merge branch 'master' of github.com:shun0102/fluent-plugin-stat

  • Loading branch information...
2 parents fdd20f2 + a2ee5af commit 0a8c99de2c2f8330d1cf303a9422371cfe0d8139 @shun0102 committed Nov 17, 2011
Showing with 26 additions and 9 deletions.
  1. +1 −2 fluent-master.conf
  2. +1 −1 fluent-slave.conf
  3. +13 −6 lib/fluent/plugin/in_stat.rb
  4. +11 −0 slaves
View
@@ -29,7 +29,6 @@
<source>
type stat
- format iostat
tag stat.iostat
interval 3s
</source>
@@ -48,7 +47,7 @@
## match tag=system.** and forward to another fluent server
<match stat.**>
type file
- path /Users/shun/log/iostat_log
+ path /data/local/mikami/log/iostat_log
flush_interval 3s
</match>
View
@@ -29,8 +29,8 @@
<source>
type stat
- format iostat
tag stat.iostat
+ interval 3s
</source>
## match tag=apache.access and write to file
@@ -19,20 +19,27 @@ def configure(conf)
def start
super
- stat = Stat.new
- interval = @interval
+
+ @thread = Thread.new(&method(:run))
+ end
- while true
- result = stat.calc_difference(interval)
+ def run
+ stat = Stat.new
+ @running = true
+ while @running
+ result = stat.calc_difference(@interval)
record = {
'hostname' => @hostname,
'stats' => result
}
-
Engine.emit(@tag, Engine.now, record)
- end
+ end
end
+ def shutdown
+ @running = false
+ @thread.join
+ end
end
end
View
11 slaves
@@ -1,3 +1,14 @@
tsukuba001
tsukuba002
tsukuba003
+tsukuba004
+tsukuba005
+tsukuba006
+tsukuba007
+tsukuba008
+tsukuba009
+tsukuba010
+tsukuba011
+tsukuba012
+tsukuba013
+tsukuba014

0 comments on commit 0a8c99d

Please sign in to comment.