fluent-plugin-filecounts 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 +4 -4
- data/fluent-plugin-filecounts.gemspec +1 -1
- data/lib/fluent/plugin/in_filecounts.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12f51f94304032c5396185dab18147b321d618c4
|
4
|
+
data.tar.gz: a15829c2041b164e14c973c43638de37bc4eae80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4111c16326c3b2adb1016781d1cafa4473a5e58d653f87bafa1d1c35349f495f8b81242e137f6f236ed665bb85f8f15aac211c7f20c9f831155cad065e91cd1
|
7
|
+
data.tar.gz: 1c99d4f3769268394acf8abd5962295b16edb368515ec882c0bfff88c334de193ff2cb55aee03d568edea87af7417392f4f7680da64a6fb0e723bd8f50c9b3fe
|
@@ -45,6 +45,7 @@ module Fluent
|
|
45
45
|
|
46
46
|
begin
|
47
47
|
|
48
|
+
event_time = Time.now.strftime('%FT%T%:z')
|
48
49
|
time_started = Engine.now
|
49
50
|
command = "bash -c '\\find #@path -name \".*\" -prune -o -print'"
|
50
51
|
files = IO.popen(command)
|
@@ -57,11 +58,11 @@ module Fluent
|
|
57
58
|
|
58
59
|
es = MultiEventStream.new
|
59
60
|
|
60
|
-
es.add(Engine.now, { "command" => command, "time_to_run" => (time_finished.to_i - time_started.to_i) })
|
61
|
+
es.add(Engine.now, { "time" => event_time, "command" => command, "time_to_run" => (time_finished.to_i - time_started.to_i) })
|
61
62
|
groups = files.group_by {|e| File.dirname(e) }
|
62
63
|
counts = Hash[groups.map{|k,v| [k, v.count]}]
|
63
64
|
time = Engine.now
|
64
|
-
counts.each {|k,v| es.add(time, Hash[ 'path', k, 'count', v ]) }
|
65
|
+
counts.each {|k,v| es.add(time, Hash[ 'time', event_time, 'path', k, 'count', v ]) }
|
65
66
|
|
66
67
|
router.emit_stream(tag, es)
|
67
68
|
|